Multiple choice technology security

What is the vulnerability in this code? int main(int argc, char * argv[]) { printf (argv[1]); }

  1. Buffer overflow

  2. Off by one error

  3. Format string vulnerability

  4. No vulnerabilities are present in this code

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The code has a format string vulnerability because printf() directly uses argv[1] as the format string. If argv[1] contains format specifiers like %n or %s, they will be interpreted by printf, allowing potential code execution or information disclosure. This is not a buffer overflow.