Courseiva
hardMultiple ChoiceObjective-mapped

CAS-004 Practice Question: During a security assessment, a tester finds that…

During a security assessment, a tester finds that a web application accepts user input and directly uses it in an LDAP query without sanitization. Which of the following attacks is most likely to be successful?

⚠ Common exam trap

The trap here is that candidates see 'user input' and 'query' and immediately think SQL injection, failing to recognize that the specific technology mentioned (LDAP) requires its own injection class, and that each injection type is tied to a distinct backend protocol.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

LDAP injection

The scenario explicitly describes unsanitized user input being used directly in an LDAP query. LDAP injection occurs when an attacker manipulates LDAP statements by injecting special characters (e.g., *, (, ), &, |, !) to alter the query logic, potentially bypassing authentication or extracting unauthorized directory information. This is a direct injection attack against the LDAP protocol (RFC 4511), not against a database or web client.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Cross-site scripting

    Why it's wrong here

    XSS involves injecting scripts into web pages, not LDAP queries.

  • SQL injection

    Why it's wrong here

    SQL injection is specific to SQL databases, not LDAP directories.

  • Remote file inclusion

    Why it's wrong here

    Remote file inclusion involves including remote files on the server, not LDAP injection.

  • LDAP injection

    Why this is correct

    LDAP injection occurs when user input is improperly concatenated into LDAP queries.

About these practice questions

This CAS-005 question is part of Courseiva's 968-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CAS-005 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CAS-005 exam.