Courseiva
Attacks and Exploits →hardMultiple Choice

PT0-002 Attacks and Exploits Practice Question

During a web application test, a tester discovers that the application uses JWTs for session management. The tester captures a JWT and notices the 'alg' header is set to 'none'. Which attack is the tester likely to perform?

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

✓

Algorithm confusion (alg:none)

If the server accepts 'none' algorithm, an attacker can forge arbitrary tokens by setting alg=none and removing the signature.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Weak secret brute-force

    Why it's wrong here

    Weak secret brute-force is incorrect because it targets JWT / HS256 tokens where the server verifies a token's HMAC-SHA256 signature using a symmetric key that is weak or guessable. An attacker would need to capture a valid signed token and then brute-force the secret to forge new tokens. In contrast, the alg:none attack exploits servers that accept a JWT with the algorithm header set to "none" and no signature at all, so no secret material is involved in the bypass.

  • ✗

    Kid injection

    Why it's wrong here

    Kid injection is not the correct answer because it manipulates the JWT header's "kid" (key ID) parameter to reference an attacker-controlled file or value, tricking the server into using that malicious key for signature verification. This attack still requires the server to verify a signature, just against an attacker-chosen key. The alg:none attack, however, completely bypasses signature verification by declaring that no algorithm is used, so the token is accepted without any cryptographic check.

  • ✓

    Algorithm confusion (alg:none)

    Why this is correct

    Algorithm confusion (alg:none) is correct because it exploits a JWT library's failure to enforce that the algorithm specified in the token's header matches a secure, expected algorithm. By setting "alg" to "none", the attacker removes the signature entirely and submits a token with only the header and payload; vulnerable servers will trust the token as if it were signed. This attack is particularly successful when the server does not explicitly block the "none" algorithm or fails to validate the token's integrity when no signature is present.

  • ✗

    Key confusion

    Why it's wrong here

    Key confusion (also called algorithm substitution) is incorrect here because it mixes HMAC and asymmetric algorithms: an attacker tricks the server into treating an RSA public key as an HMAC secret, then signs a forged token with that public key. This requires the server to support both RS256 and HS256 and to use the public key as the symmetric secret. The alg:none attack is fundamentally different—it demands no signature at all, whereas key confusion still involves producing a valid HMAC signature.

About these practice questions

This PT0-003 question is part of Courseiva's 777-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 PT0-003 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 PT0-003 exam.