Question 320 A C application copies a user string into a fixed-size stack array without checking length. Which remediation fits? Remove diagnostic logging only Lengthen the stack return address Bounded copying with correct length validation and memory-safe design Run the process as administrator Explanation Correct Answer C:Bounds checks or safer languages reduce stack overflow opportunities. Incorrect Answers A:Logging does not enforce bounds. B:Return-address format is not the fix. D:Privilege increases exploitation impact.
Question 321 An integer addition can wrap before a buffer allocation, producing a smaller-than-needed allocation. What vulnerability is involved? Cross-origin resource sharing misconfiguration Integer overflow leading to unsafe size calculation Weak TLS hostname validation A DNS zone transfer flaw Explanation Correct Answer B:Wrapped arithmetic can under-allocate memory and cause subsequent corruption. Incorrect Answers A:CORS does not affect integer arithmetic. C:Certificates are unrelated to integer overflow. D:DNS is unrelated to allocation math.
Question 322 A native service allocates a heap buffer and continues writing after its end during message parsing. What defensive action is appropriate? Increase TLS certificate validity Disable incident response logging Fix bounds handling and apply memory safety mitigations in the build Rename the service account Explanation Correct Answer C:Out-of-bounds heap writes can corrupt adjacent allocations. Incorrect Answers A:PKI changes do not prevent heap corruption. B:This hides signs without fixing memory safety. D:Identity naming does not bound writes.
Question 323 A model-training pipeline imports public labeled samples without checking provenance, and some labels appear deliberately wrong. What attack class is relevant? A certificate pinning failure DNS amplification A local kernel privilege escalation Training-data poisoning Explanation Correct Answer D:Adversarially altered inputs can degrade or redirect model decisions. Incorrect Answers A:The scenario concerns labels, not TLS trust. B:No DNS traffic is described. C:The primary issue is data integrity during training.
Question 324 A web application permits administrative functions to users whose client-side UI simply hides the admin button. What is the flaw? A browser compatibility problem alone A valid defense because buttons are hidden A bandwidth saturation issue Missing server-side authorization enforcement Explanation Correct Answer D:Hiding UI elements does not enforce permissions on direct requests. Incorrect Answers A:The server must deny unauthorized operations. B:Clients are not trusted access-control authorities. C:Throughput is not the access check.
Question 325 A payment service stores cardholder data encrypted but writes the decryption key in the same publicly readable configuration bucket. What is the weakness? The data needs a shorter file name The CPU architecture must be replaced Key custody failure undermining encryption-at-rest protection Encryption is automatically useless in every deployment Explanation Correct Answer C:Exposed keys can defeat otherwise strong stored-data encryption. Incorrect Answers A:Naming cannot protect secrets. B:Hardware type is not the specified failure. D:Strong encryption remains valuable with secure keys.
Question 326 A development team accidentally commits an active production API secret to a public repository. What should be done? Only hide the repository without revoking the token Increase the secret's expiration period Revoke and rotate the secret, investigate use and prevent future leaks Assume no one saw the file because it was published briefly Explanation Correct Answer C:Deleting the commit alone cannot guarantee a copied secret is unusable. Incorrect Answers A:Copies may already exist. B:That prolongs attacker access. D:Automated scrapers can detect exposed keys.
Question 327 A vendor library is end-of-life but still handles live authentication. What treatment is appropriate? Ignore because the current release starts successfully Turn off authentication monitoring Plan supported replacement with interim restrictions and monitoring Make it public to attract bug reports without control Explanation Correct Answer C:Unsupported critical code accumulates unpatched vulnerabilities. Incorrect Answers A:Functionality does not imply support or security. B:That decreases visibility. D:Exposure is not a safe treatment.
Question 328 A browser app renders a URL parameter directly inside a JavaScript string. Which mitigation must consider the output context? JavaScript-context-safe encoding or safe DOM APIs Only HTML entity encoding for all contexts A password complexity policy A firewall rule for port 22 Explanation Correct Answer A:HTML encoding alone may not protect script-string contexts. Incorrect Answers B:Different contexts have different escaping rules. C:Passwords do not govern rendering. D:SSH rules do not fix client-side injection.
Question 329 A file upload service checks only the filename extension before storing executable content in a web-executable directory. What should change? Use a longer upload button label Validate type/content and store uploads outside executable web paths Trust .jpg extensions as proof of image safety Give the upload directory full execute rights Explanation Correct Answer B:Safe storage and content checks reduce upload-to-execution risks. Incorrect Answers A:UI wording cannot secure storage. C:Extensions are attacker-controlled. D:That enables abuse.
Question 330 A service permits a remote client to submit a relative path that is dynamically included as code from another URL. What class of weakness is suggested? Remote file inclusion A harmless static HTML reference An expired certificate automatically A pure DNS TTL issue Explanation Correct Answer A:Including attacker-controlled external content can introduce remote code. Incorrect Answers B:The application executes included code. C:No certificate problem is described. D:The weakness is dynamic file inclusion.