Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
CompTIA CySA+ Cybersecurity Analyst · CompTIA
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
Correct Answer: C. Hard-coded credential Analysis: The snippet getConnection(database01,"alpha" ,"AxTv.127GdCx94GTd"); suggests that the credentials (in this case, a password) are directly embedded in the code. This practice, known as hard-coded credentials, is a security risk because it can be easily extracted by anyone with access to the code or debugging information. Explanation of Other Options: A. Lack of input validation: This generally refers to improper validation of user inputs, which is not evident in the provided code snippet. B. SQL injection: This involves injecting malicious SQL code into a query, but the provided code snippet does not show any user inputs being incorporated into a SQL statement. D. Buffer overflow: This vulnerability occurs when more data is written to a buffer than it can hold, leading to overwriting of adjacent memory. The given code snippet does not indicate any buffer management issues.
Is asking for vulnerability on the system so it most be A
Hardcoded passwords is also a vulnerability..