Threats, Vulnerabilities, and Attacks

A security analyst reviews source code for hardcoded secrets. Which of the following findings are examples of hardcoded secrets? (Choose three.)

Choose 3 answers

Show the answer

Correct answersC. An API key assigned to a variable in the application's source codeE. A private SSH key embedded in a container imageF. A database password written as a string in a config file committed to the repository

AWhy not this: A session timeout is a session management setting and holds no credential.

BWhy not this: A length rule is a password policy control, not a stored credential in code.

CWhy this is right: An API key written into source code is a hardcoded secret that is exposed to anyone who reads the code.

DWhy not this: A generic error message is safe exception handling and stores no secret.

EWhy this is right: A private key baked into an image is a secret that anyone who obtains the image can extract.

FWhy this is right: A password committed in a config file is a stored credential that anyone with repository access can read.

Hardcoded secrets are credentials, keys or tokens stored in plain form in code, configuration files or images. A password length rule, a generic error message and a session timeout are not stored secrets. The generic error message is a safe exception-handling practice.