A software security engineer is reviewing static code analysis findings for a legacy file rendering service. The report identifies two vulnerabilities: one where unvalidated user input is directly concatenated into a shell command string, allowing arbitrary system execution, and another where arithmetic calculations for buffer allocation fail to validate integer limits, leading to potential heap buffer overflows. Which of the following remediation techniques should the team implement to directly fix these code-level software vulnerabilities? (Select TWO).
- Replace direct shell command execution calls with parameterized API functions and strict input allowlists.Cevap
- Implement explicit integer bounds checking and range validation before dynamic memory allocation calls.Cevap
- CDeploy network-level perimeter firewalls to filter incoming SQL syntax keywords from web requests.
- DMigrate service authentication from HTTP Basic auth headers to OAuth 2.0 bearer token validation.
Cevap
The team should replace direct shell execution calls with parameterized API functions (and strict allowlisting) to address command injection, and implement explicit integer bounds checking prior to dynamic memory allocation to prevent heap buffer overflows.
Replacing shell calls with parameterized execution prevents malicious input from breaking out of data context into executable commands. Additionally, checking integer upper limits before allocating dynamic memory prevents integer overflow wrap-arounds from yielding undersized buffers.
Adım Adım Çözüm
Anahtar Kavram
Remediating Application Code Vulnerabilities (Command Injection & Memory Management Flaws)
Tahmini Süre:1m 30s