nerdexam
CompTIA

CS0-003 · Question #103

A security analyst found an old version of OpenSSH running on a DMZ server and determined the following piece of code could have led to a command execution through an integer overflow; Which of the fo

The correct answer is C. Use built-in functions from libraries to check and handle long numbers properly.. The vulnerability in the code is an integer overflow, which happens when the size of a variable exceeds its maximum capacity. Attackers can exploit this vulnerability to execute arbitrary code, escalate privileges, or cause a denial of service. To prevent integer overflows, it is

Submitted by amina.ke· Mar 6, 2026Vulnerability Management

Question

A security analyst found an old version of OpenSSH running on a DMZ server and determined the following piece of code could have led to a command execution through an integer overflow; Which of the following controls must be in place to prevent this vulnerability?

Exhibit

CS0-003 question #103 exhibit

Options

  • AConvert all integer numbers in strings to handle the memory buffer correctly.
  • BImplement float numbers instead of integers to prevent integer overflows.
  • CUse built-in functions from libraries to check and handle long numbers properly.
  • DSanitize user inputs, avoiding small numbers that cannot be handled in the memory.

How the community answered

(33 responses)
  • A
    6% (2)
  • B
    3% (1)
  • C
    79% (26)
  • D
    12% (4)

Explanation

The vulnerability in the code is an integer overflow, which happens when the size of a variable exceeds its maximum capacity. Attackers can exploit this vulnerability to execute arbitrary code, escalate privileges, or cause a denial of service. To prevent integer overflows, it is recommended to use built-in functions from libraries to check and handle long numbers properly. In this case, OpenSSH should be updated to the latest version, which includes patches to fix this vulnerability. Additionally, it is good practice to use static analysis tools and perform code reviews to detect vulnerabilities before they are deployed to production.

Topics

#Integer overflow#Secure coding#Software vulnerability#Input validation

Community Discussion

No community discussion yet for this question.

Full CS0-003 Practice