Steps to reproduce:
Create a hardcore world
After spawning in, revoke your own operator permissions via the menu on right side of screen (set to visitor or member)
Set your permissions back to operator and select "OP WITH CHEATS ON"
You now have access to cheats in the hardcore world
Related issues
Comments


Can confirm. Relates to MCPE-180305. The method described here can also be used to enable cheats in LAN, which is WAI according to MC-134.
Obserbed results:
Cheats can be enabled following the above steps. Which can also be used when playing in LAN, which is WAI. But since this can also be used in a normal world with LAN disabled, it's considered a bug.
Expected results:
Hardcore worlds shouldn't have a way of enabling cheats unless they are set to LAN. Nor should said method of obtaining cheats be possible in a world regardless of whether LAN is enabled or disabled.

Confirmed in 1.21.44

Can confirm in 1.21.50 on Windows 10

Affects 1.21.70.22 preview
This some other methods to reproduce this:
1.Choose super flat world, open cheats, then choose hardcore mode.
2.Choose an experimental game content, open cheats, then choose hardcore mode.