← Back to context

Comment by rwmj

5 days ago

It compiles fine as C (using gcc-15.1.1-2.fc43.x86_64). Here's the complete program that I tested before posting the comment above:

  int environmentǃ;
  int main()
  {
    if(environmentǃ=0){
      // bypass authZ checks in DEV
      return 0;
    }
    return 1;
  }

The output of GCC is:

  $ gcc -Wall test.c
  test.c: In function ‘main’:
  test.c:4:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
      4 |   if(environmentǃ=0){
        |      ^~~~~~~~~~~~

In a real exploit you'd have to be smarter about hiding the variable declaration (maybe in a library or something).