Skip to content
Sharp

OWASP Vulnerabilities · interview question

In the context of JWTs, what is the risk of not validating the 'alg' field in the header?

Multiple choiceHardchapter-17-curatedpremiumowasp-vulnerabilitiessql-injection
Choose one answer
Answer and explanation

Correct answer

B. An attacker can use a weak algorithm to forge tokens

Why

Not validating the 'alg' field allows attackers to specify weaker algorithms, potentially forging tokens by computing a signature that matches the server's public key, compromising the token's integrity.

Test yourself on OWASP Vulnerabilities

A free test with instant, explained results. No account needed.

Start free test
All OWASP Vulnerabilities questions →