Software

EasyMediumHard
12345678910111213141516
Question 8
Medium

An auxiliary module in a legacy banking application uses the standard C library function gets()\text{gets()}gets() to read a user-provided transaction reference into a fixed-size buffer allocated on the call stack.

Which vulnerability is present in this module, and which mitigation represents the most robust software development practice to resolve it?

Buffer overflow; replace gets()\text{gets()}gets() with a bounds-checked alternative such as fgets()\text{fgets()}fgets() and implement strict input validation.

SQL injection; implement parameterised database queries and deploy a web application firewall.

Stack overflow; increase the stack segment size in the compiler settings to accommodate larger input strings.

Integer overflow; cast the input string into a double-precision floating-point number before memory allocation.

Software Questions

  1. GCSE
  2. /Computer Science
  3. /Software