Courseiva
Web Application Attacks →mediumMultiple Choice

PEN-200 Web Application Attacks Practice Question

During a web assessment, you find that an application uses an insecure random number generator for token creation. What is the main security implication of this flaw?

⚠ Common exam trap

Candidates often confuse random number generation flaws with encryption key length issues, failing to realize that predictability directly allows attackers to forge tokens and hijack active user sessions effortlessly.

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

✓

It leads to session hijacking through token prediction.

Predictable tokens compromise the integrity of session management and password reset mechanisms. If an attacker can determine the algorithm and seed used by the generator, they can forge valid session tokens or reset codes for other users. This vulnerability highlights the necessity of using cryptographically secure pseudorandom number generators (CSPRNGs) to ensure that sensitive authentication tokens cannot be guessed or recreated by adversaries.

Answer analysis

Option-by-option breakdown

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

  • ✗

    It allows attackers to perform Cross-Site Request Forgery (CSRF).

    Why it's wrong here

    CSRF is prevented by using unpredictable tokens, but the vulnerability itself is about unauthorized state changes. Using a weak generator for CSRF tokens makes the defense useless, but the weakness is in the token generation, not the CSRF attack mechanism itself.

  • ✓

    It leads to session hijacking through token prediction.

    Why this is correct

    If the random number generator is predictable, an attacker can generate a sequence of valid tokens and potentially hijack active user sessions. This allows unauthorized access to user accounts without needing to know a password, representing a severe flaw in authentication and session integrity.

  • ✗

    It triggers a stack overflow in the web server process.

    Why it's wrong here

    Random number generation flaws are logical vulnerabilities, not memory corruption vulnerabilities. They do not cause stack overflows. Stack overflows are caused by improper memory management, such as buffer overflows, and are entirely unrelated to the quality of random numbers used for tokens.

  • ✗

    It makes the application vulnerable to SQL Injection.

    Why it's wrong here

    Random number generation is a logic and cryptography issue. SQL injection occurs at the database query level due to unsanitized input. These are distinct areas of security; a weak number generator does not facilitate SQL injection, as they involve different parts of the application's code.

Visual reference

Client DHCP Server 1 Discover (broadcast) 2 Offer (IP: 192.168.1.10) 3 Request (I accept) 4 Acknowledge (lease confirmed) DORA — the four-step DHCP lease process

About these practice questions

This PEN-200 question is part of Courseiva's 285-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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official OffSec exam blueprint

This PEN-200 practice question is part of Courseiva's free OffSec 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 PEN-200 exam.