Question 198 of 509
Attacks and ExploitshardMultiple ChoiceObjective-mapped

Quick Answer

The answer is to set the algorithm header to 'none', executing a JWT none algorithm attack. This works because the 'none' algorithm instructs the JWT library to accept the token without verifying any signature, effectively bypassing authentication entirely. If the application’s JWT parser is not configured to reject tokens with the 'none' algorithm, the forged token will be treated as valid, allowing the tester to impersonate any user without knowing the secret key. On the CompTIA PenTest+ PT0-002 exam, this scenario tests your understanding of JWT header manipulation and common misconfigurations in authentication libraries. A common trap is assuming you must crack the key or exploit the 'kid' parameter directly, but the core vulnerability here is the library’s failure to enforce algorithm restrictions. Memory tip: think “None means no signature needed” — if the header says 'none', the token is an open door.

PT0-002 Attacks and Exploits Practice Question

This PT0-002 practice question tests your understanding of attacks and exploits. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A penetration tester is assessing a web application that uses JSON Web Tokens (JWT) for authentication. The tester captures a valid JWT from a user session. The JWT header contains a 'kid' (key ID) parameter. The tester suspects the application is vulnerable to a key injection attack via the 'kid' parameter. Which attack technique should the tester use to forge a valid JWT without knowing the secret key?

Question 1hardmultiple choice
Full question →

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

Set the algorithm header to 'none' (null signature attack).

Option A is correct because setting the algorithm header to 'none' removes the need for a signature entirely. The JWT library, if not properly configured to reject 'none' algorithm tokens, will accept the forged token as valid, allowing the tester to impersonate any user without knowing the secret key.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Set the algorithm header to 'none' (null signature attack).

    Why this is correct

    If the server accepts tokens with algorithm 'none', it will skip signature verification, allowing the tester to forge any token.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Replace the 'kid' value with a path to a known file on the server (e.g., /dev/null) that contains predictable content.

    Why it's wrong here

    This is a different attack (kid traversal) that uses the file's content as the HMAC key, but it requires the server to use HMAC and does not bypass signature if the algorithm is correct.

  • Use a side-channel attack to extract the secret key.

    Why it's wrong here

    Side-channel attacks require close physical access or detailed system knowledge, not practical in a remote test.

  • Perform a timing attack to recover the secret key character by character.

    Why it's wrong here

    Timing attacks are possible but require many requests and are not the most direct method for this scenario.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates confuse the 'none' algorithm attack with the 'kid' injection attack (option B), but the question specifically asks for a technique to forge a token without knowing the secret key, which the 'none' attack achieves directly.

Trap categories for this question

  • Scenario analysis trap

    Timing attacks are possible but require many requests and are not the most direct method for this scenario.

Detailed technical explanation

How to think about this question

The 'none' algorithm attack exploits a known vulnerability in JWT libraries where the server fails to enforce a whitelist of allowed algorithms. When the header's 'alg' is set to 'none', the signature is omitted, and the server may skip signature verification entirely. This attack is documented in RFC 7515 Section 8.2 and is a common finding in web application penetration tests.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A developer is choosing between AES-256 (symmetric) and RSA-2048 (asymmetric) for encrypting a large file that will be sent to a partner. Symmetric encryption is fast but requires key exchange; asymmetric is slower but solves the key distribution problem. A hybrid approach — encrypt the file with AES, encrypt the AES key with RSA — is standard. Questions like this test whether you understand when each approach applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PT0-002 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PT0-002 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PT0-002 question test?

Attacks and Exploits — This question tests Attacks and Exploits — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Set the algorithm header to 'none' (null signature attack). — Option A is correct because setting the algorithm header to 'none' removes the need for a signature entirely. The JWT library, if not properly configured to reject 'none' algorithm tokens, will accept the forged token as valid, allowing the tester to impersonate any user without knowing the secret key.

What should I do if I get this PT0-002 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 25, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PT0-002 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-002 exam.