C standard imposes no restriction on attempting to modify a string literal. However, if you attempt to modify a string literal, the outcome is undefined behaviour.
C11, chapter 6.4.5 (String literals)/P7
[...] If the program attempts to modify such an array, the behavior is undefined.
The fact that you think the program is allowing you to modify the content of the string literal is one of the many outcome of the UB.