Title: Web Security — LearnCoachAssist

Q: What is web security?
A: Web security is the practice of protecting web applications, users, and data from malicious access, misuse, or disruption.

Q: Why is web security important?
A: Security failures damage trust, expose sensitive data, and can create legal, financial, and operational harm.

Q: What is authentication?
A: Authentication verifies who a user or system claims to be.

Q: What is authorization?
A: Authorization determines what an authenticated user is allowed to access or do.

Q: What is the principle of least privilege?
A: It means giving users and systems only the minimum access needed to perform their tasks.

Q: What is SQL injection?
A: SQL injection is an attack where untrusted input changes a database query in unintended and dangerous ways.

Q: How do parameterized queries help?
A: Parameterized queries separate data from query structure so user input is not treated as executable SQL.

Q: What is cross-site scripting (XSS)?
A: XSS is an attack where malicious script is injected into content that other users load in their browser.

Q: How does output escaping reduce XSS risk?
A: Escaping ensures untrusted content is treated as text instead of executable HTML or JavaScript.

Q: What is cross-site request forgery (CSRF)?
A: CSRF tricks a user's browser into sending a request they did not intend while already authenticated.

Q: How do CSRF tokens help?
A: They prove that a state-changing request came from the legitimate application flow.

Q: What is input validation?
A: Input validation checks whether incoming data matches expected type, format, and constraints before it is processed.

Q: Why is server-side validation still necessary?
A: Client-side validation can improve UX, but attackers can bypass it completely.

Q: What is secure password storage?
A: Secure password storage uses strong one-way hashing with salting so raw passwords are never stored.

Q: Why should HTTPS be mandatory?
A: HTTPS encrypts traffic in transit and helps prevent interception or tampering between client and server.

Q: What is a secure cookie setting?
A: A secure cookie is configured with attributes like Secure, HttpOnly, and SameSite to reduce theft and abuse.

Q: What does HttpOnly do for cookies?
A: HttpOnly helps prevent JavaScript from reading the cookie directly, reducing some XSS impact.

Q: What does SameSite do for cookies?
A: SameSite reduces the chance that browsers send cookies automatically in cross-site request contexts.

Q: What is content security policy (CSP)?
A: CSP is a browser policy that restricts what scripts, styles, and resources can load on a page.

Q: Why are dependencies a security concern?
A: Third-party packages can contain vulnerabilities that become part of your application attack surface.

Q: What is rate limiting?
A: Rate limiting restricts how often requests can be made in a time window to reduce abuse and brute-force attacks.

Q: What is brute-force protection?
A: Brute-force protection slows or blocks repeated authentication attempts designed to guess credentials.

Q: Why should logs avoid sensitive data?
A: Logs often live longer and are more widely accessible than production data paths, so secrets there create extra exposure.

Q: What is secret management?
A: Secret management is the secure storage and rotation of credentials, API keys, and tokens outside source code.

Q: What is a security header?
A: A security header is an HTTP response header that adds browser protections, such as CSP or X-Frame-Options.

Q: What is clickjacking?
A: Clickjacking tricks users into clicking hidden or disguised UI elements on top of another page.

Q: How does X-Frame-Options help?
A: It limits whether your pages can be embedded in frames, reducing clickjacking risk.

Q: What is session fixation?
A: Session fixation is an attack where the attacker forces a known session identifier on the victim before login.

Q: Why should sessions rotate on login?
A: Rotating the session ID after authentication reduces the risk that a fixed or stolen session remains valid.

Q: What is a practical web security habit?
A: Treat all untrusted input carefully, keep dependencies updated, and design for least privilege by default.

Q: What is threat modeling?
A: Threat modeling is the practice of identifying likely attackers, assets, entry points, and abuse scenarios before building or changing systems.

Q: Why should security reviews happen early?
A: Issues are cheaper to prevent in design than to retrofit after insecure assumptions are in production.

Q: What is broken access control?
A: Broken access control happens when users can reach data or actions outside the permissions they should have.

Q: Why should direct object references be checked carefully?
A: Predictable resource identifiers can expose unauthorized data if ownership and permission checks are weak.

Q: What is secure-by-default design?
A: It means the safest configuration is the starting point instead of something users must remember to enable.

Q: Why should error messages avoid sensitive detail?
A: Detailed internal errors can help attackers learn about infrastructure, queries, or validation behavior.

Q: What is an audit trail?
A: An audit trail is a record of important actions that supports investigation, accountability, and detection.

Q: Why should privileged actions be logged distinctly?
A: Security-sensitive actions need clearer visibility so abuse or mistakes can be found and reviewed quickly.

Q: What is origin validation?
A: Origin validation checks whether cross-site requests truly come from allowed origins before granting access.

Q: What is dependency pinning?
A: Dependency pinning fixes exact versions to reduce surprise changes and make patching more deliberate.

Q: Why should backups be considered part of security?
A: Recovery from deletion, corruption, or ransomware is part of protecting the business and its users.

Q: What is a durable web-security habit?
A: Design defensively, validate aggressively, and assume attackers will test every exposed boundary.

Q: What is the OWASP Top 10?
A: It is a regularly updated list of the ten most critical web application security risks, published by the Open Worldwide Application Security Project.

Q: What is CWE?
A: Common Weakness Enumeration is a community-developed catalog of software and hardware weaknesses, each with a unique CWE-ID and description.

Q: What is CVE?
A: Common Vulnerabilities and Exposures is a public reference system that assigns unique IDs to publicly known security vulnerabilities.

Q: What is CVSS?
A: The Common Vulnerability Scoring System scores vulnerabilities on a 0.0–10.0 scale based on impact, exploitability, and scope.

Q: What is a reflected XSS payload?
A: It is malicious script that is included in a request (e.g. in the URL) and immediately echoed back in the response to execute in the victim's browser.

Q: What is stored XSS?
A: It is XSS where the malicious payload is persisted on the server (e.g. in a comment or profile field) and runs for every user that views the affected page.

Q: What is DOM-based XSS?
A: It is XSS where the vulnerability is in client-side JavaScript that reads an attacker-controllable source (like location.hash) and writes it to a dangerous sink.

Q: What is the difference between HTML escaping and JavaScript escaping?
A: HTML escaping neutralizes characters for safe insertion into HTML text or attributes; JavaScript escaping neutralizes characters before embedding data inside a JS string or block.

Q: What is a Content-Type sniffing risk?
A: Without a correct Content-Type and X-Content-Type-Options: nosniff, browsers may guess a response's type, allowing uploads (e.g. text/plain) to be interpreted as HTML or script.

Q: What is HSTS?
A: HTTP Strict Transport Security is a response header that instructs browsers to only contact the site over HTTPS for a specified max-age period.

Q: What does X-Content-Type-Options: nosniff do?
A: It tells browsers not to MIME-sniff a response away from the declared Content-Type, reducing content-type confusion attacks.

Q: What is the Referrer-Policy header for?
A: It controls how much of the URL is sent in the Referer header when users navigate away, reducing leakage of sensitive paths or query parameters.

Q: What is a "magic" cookie vs a signed token?
A: A magic cookie stores opaque state on the client and trusts the client value; a signed token (e.g. HMAC) lets the server verify the value was not tampered with.

Q: What is the danger of putting roles in a JWT?
A: Client-side tokens cannot be trusted to be authoritative: if the server does not re-check roles on every request, attackers can escalate by modifying the token.

Q: What is open redirect?
A: It is a vulnerability where the app redirects to a user-supplied URL without validation, enabling phishing by sending victims to attacker-controlled sites.

Q: What is SSRF?
A: Server-Side Request Forgery is when an attacker causes the server to make an HTTP (or other) request to an unintended target, often an internal service.

Q: What is the impact of a successful SSRF?
A: It can expose internal services, cloud metadata endpoints (e.g. IMDS), and let attackers pivot into private networks or steal credentials.

Q: What is XXE?
A: XML External Entity is an attack against XML parsers that process attacker-controlled DTD entities, often leading to file disclosure or SSRF.

Q: How do you mitigate XXE?
A: Disable external entity and DTD processing in the XML parser, or use a less expressive format like JSON when possible.

Q: What is IDOR?
A: Insecure Direct Object Reference is when an app uses a user-supplied identifier to fetch an object without verifying the requester is allowed to access it.

Q: What is horizontal vs vertical privilege escalation?
A: Horizontal: accessing another user's data at the same privilege level. Vertical: gaining higher privilege (e.g. becoming admin) from a lower-privileged account.

Q: What is a path traversal attack?
A: It uses sequences like ../../ in file-related input to read or write files outside the intended directory.

Q: What is a second-order SQL injection?
A: It is SQLi where attacker input is stored safely at first, then later concatenated into a query in a different context where it becomes executable.

Q: What is blind SQL injection?
A: It is SQLi where the application does not return query results directly, but the attacker infers data from boolean, time, or error-based side channels.

Q: What is a time-based blind SQLi technique?
A: It uses payloads like SLEEP() or WAITFOR DELAY to cause measurable delays when a condition is true, leaking data one bit at a time.

Q: What is SQL injection UNION-based attack?
A: It appends a UNION SELECT to append rows from another query to the result, allowing the attacker to read arbitrary tables.

Q: What is mass assignment?
A: It is a vulnerability where a framework binds all incoming request fields to a model, letting attackers set fields like is_admin they should not control.

Q: What is prototype pollution?
A: It is a JavaScript-specific attack where Object.prototype or similar prototypes are modified through unsafe deep-merge of attacker input, leading to RCE or auth bypass in some apps.

Q: What is insecure deserialization?
A: It is when untrusted serialized data is deserialized into objects without integrity checks, often allowing remote code execution, replay, or privilege escalation.

Q: What is SSRF via URL parser confusion?
A: Different libraries parse URLs differently (e.g. @, backslash, embedded credentials), so a "validated" URL may resolve to an internal host the parser hides.

Q: What is a CRLF injection?
A: It is injection of carriage return or line feed characters into HTTP headers or logs, allowing header splitting, response splitting, or log forgery.

Q: What is HTTP request smuggling?
A: It exploits differences between front-end and back-end parsers of Content-Length vs Transfer-Encoding: chunked, allowing attackers to prepend or hide requests.

Q: What is subdomain takeover?
A: It is when a DNS record points to an external service (e.g. a dangling CNAME) that the attacker can claim, effectively controlling a subdomain of the victim.

Q: What is CORS?
A: Cross-Origin Resource Sharing is a browser mechanism that allows servers to opt in to cross-origin requests via specific response headers like Access-Control-Allow-Origin.

Q: What is the risk of reflecting the Origin header in CORS?
A: Setting Access-Control-Allow-Origin: effectively disables the same-origin policy, allowing any site to read responses with the victim's cookies.

Q: Why must Access-Control-Allow-Credentials only be used with an explicit allow-list?
A: Allowing credentials with a wildcard or a reflected origin lets third-party sites read authenticated responses, breaking the entire same-origin model.

Q: What is a preflight OPTIONS request?
A: It is a CORS pre-check the browser sends for non-simple requests to ask the server which methods, headers, and origins are permitted before the real request.

Q: What is CORS not a substitute for?
A: It is not an authentication or authorization mechanism: it is a browser relaxation of SOP, and the server must still authorize every request.

Q: What is the Same-Origin Policy?
A: SOP is the browser rule that scripts from one origin can normally read responses only from the same origin (scheme + host + port).

Q: What is SOP same-site vs same-origin?
A: Same-origin is stricter (scheme+host+port must match). Same-site allows eTLD+1 to match (e.g. a.example and b.example) and is used by SameSite cookies.

Q: What is mixed content?
A: It is when an HTTPS page loads subresources (scripts, images, iframes) over HTTP, breaking the page's security guarantees and being blocked by modern browsers.

Q: What is certificate pinning?
A: It is when a client restricts which TLS certificates it will accept for a given host, reducing risk of mis-issued or rogue CAs.

Q: What is DNSSEC?
A: It is a set of DNS extensions that cryptographically sign DNS records so clients can verify answers were not tampered with in transit.

Q: What is a timing attack on authentication?
A: It is an attack that infers valid usernames or correct password characters by measuring small differences in server response time, requiring constant-time comparisons to mitigate.

Q: What is constant-time comparison?
A: It is a comparison routine whose execution time does not depend on the inputs, used to prevent leaking secret information through timing side channels.

Q: Why is bcrypt preferred over plain SHA-256 for passwords?
A: bcrypt is intentionally slow and includes a salt, so brute-forcing is costly even if the database leaks, whereas raw SHA-256 is fast and GPU-friendly.

Q: What is the role of a password salt?
A: A unique random salt per password makes precomputed rainbow tables useless and forces attackers to crack hashes individually.

Q: What is the recommended password hashing API in modern PHP?
A: password_hash() with PASSWORD_BCRYPT or PASSWORD_ARGON2ID, and password_verify() to check, since they handle salts and algorithm choice.

Q: What is password stretching?
A: It is repeatedly applying a hash function (e.g. PBKDF2 with many iterations, bcrypt cost, or Argon2) to make each guess expensive.

Q: What is a pepper in password storage?
A: It is a server-side secret, separate from the database, mixed into the hash so a stolen hash database alone cannot be cracked offline.

Q: Why are security questions a weak authentication factor?
A: They rely on public or guessable facts (mother's maiden name, first pet) and can be enumerated through social media or OSINT.

Q: What is MFA fatigue?
A: It is an attack where the attacker repeatedly triggers push-based MFA prompts hoping the user finally approves one to stop the notifications.

Q: What is an MFA bypass via session theft?
A: It is when an attacker steals a session cookie after the user has completed MFA, bypassing the second factor entirely until logout.

Q: What is phishing-resistant MFA?
A: Phishing-resistant factors (FIDO2/WebAuthn security keys, device-bound passkeys) bind the credential to the legitimate origin, so fake sites cannot relay it.

Q: What is the difference between authentication and session management?
A: Authentication verifies identity at login; session management maintains that authenticated state across subsequent requests, usually via a session ID cookie.

Q: What is a session token entropy requirement?
A: It should be at least 128 bits of randomness (e.g. 16+ bytes from a CSPRNG) so it cannot be guessed in any reasonable time.

Q: What are the secure cookie attributes?
A: Secure (HTTPS only), HttpOnly (no JS access), SameSite=Lax or Strict (limits cross-site sending), and a tight Path/Domain scope.

Q: What does SameSite=Strict do?
A: It prevents the cookie from being sent on any cross-site request, including top-level navigations, breaking some login flows but maximizing CSRF protection.

Q: What does SameSite=Lax do?
A: It allows the cookie on top-level navigations (e.g. following a link) but blocks it on most other cross-site requests, balancing usability and CSRF protection.

Q: What is the double-submit cookie CSRF defense?
A: The server sets a CSRF cookie and expects the client to read it and echo the value in a request header or field; since attackers cannot read the cookie cross-site, the values will not match.

Q: What is the synchronizer token pattern for CSRF?
A: The server binds a random CSRF token to the user's session and requires it on every state-changing request, rejecting requests without a valid match.

Q: What is the difference between CSRF and clickjacking?
A: CSRF abuses the user's authenticated session to trigger an unintended action. Clickjacking tricks the user into clicking something disguised inside an overlaid UI.

Q: What is X-Frame-Options: DENY?
A: It forbids the page from being rendered in any frame or iframe, fully preventing clickjacking attacks against that page.

Q: What is frame-ancestors in CSP?
A: It is the CSP directive that replaces X-Frame-Options, declaring which origins (or 'none', 'self') are allowed to embed the page in frames.

Q: What is a nonce-based CSP for inline scripts?
A: The server generates a per-request random nonce, includes it in the CSP header (e.g. script-src 'nonce-abc123') and on each allowed

Q: What is a strict-dynamic CSP?
A: It is a CSP that uses 'strict-dynamic' to trust scripts loaded by a nonce-bearing script, avoiding the need to allowlist every CDN URL.

Q: What is the risk of unsafe-inline in CSP?
A: 'unsafe-inline' allows arbitrary inline scripts, defeating the main XSS protection CSP provides and should never appear in a secure policy.

Q: What is the risk of unsafe-eval in CSP?
A: 'unsafe-eval' allows eval(), setTimeout(string), and similar, which can be abused to construct and run attacker code from string data.

Q: What is a data exfiltration risk via form actions?
A: Forms posting to attacker-controlled endpoints can leak autocomplete data, password manager entries, or PII; restrict form-action in CSP.

Q: What is the purpose of a Subresource Integrity (SRI) hash?
A: SRI lets the browser verify that a fetched script or stylesheet matches a known hash, so a compromised CDN cannot serve modified code.

Q: What is the recommended way to load third-party scripts?
A: Pin specific versions, serve them yourself or via SRI, isolate them (e.g. iframe with sandbox + strict CSP), and review what data they collect.

Q: What is a CSP report-only mode?
A: It is a Content-Security-Policy-Report-Only header that reports violations to a URI without enforcing, used to safely tune a strict policy.

Q: What is the Sec-Fetch-* request header family?
A: It is a set of headers (Sec-Fetch-Site, Sec-Fetch-Mode, Sec-Fetch-Dest) browsers send to indicate the request's origin relationship, useful for server-side origin checks.

Q: What is the difference between Vary: Cookie and Vary: Origin?
A: Vary: Cookie ensures caches do not serve one user's response to another. Vary: Origin/Authorization etc. prevents CDN caches from serving variant responses to the wrong consumer.

Q: What is a cache poisoning attack?
A: It is when an attacker tricks a cache to store a response keyed on a value the attacker controls (e.g. an unkeyed header), then serves that poisoned response to other users.

Q: What is HTTP response splitting?
A: It is an attack where CRLF in headers lets the attacker inject additional response headers or even a second response, often now blocked by header sanitization.

Q: What is a web cache deception attack?
A: It tricks the victim into caching a dynamic, authenticated page (e.g. /account) under a static-looking URL, then the attacker retrieves that cached content.

Q: What is the impact of a compromised cookie store?
A: Stolen session cookies allow attackers to impersonate users until expiry or rotation, bypassing passwords and even some MFA.

Q: What is cookie tossing?
A: It is a subdomain-based attack where an attacker sets a cookie on a parent domain from a sibling subdomain, used to fixate sessions or override settings.

Q: What is the __Host- cookie prefix?
A: It is a cookie name prefix that requires Secure, no Domain attribute, and Path=/, guaranteeing the cookie is bound to the exact host and not overwritten by subdomains.

Q: What is the __Secure- cookie prefix?
A: It is a name prefix that requires the Secure attribute, so the cookie is only set over HTTPS and cannot be silently downgraded.

Q: What is anti-CSRF for Same-Site lax?
A: SameSite=Lax blocks most cross-site POSTs, but legacy apps and certain flows still need explicit CSRF tokens for defense in depth.

Q: What is a CAPTCHA's role in security?
A: CAPTCHAs slow down automated abuse (credential stuffing, scraping, spam) but are not authentication and are increasingly bypassable, so they should be one layer, not the only one.

Q: What is credential stuffing?
A: It is an attack that reuses large lists of username/password pairs from other breaches, succeeding because many users reuse passwords across sites.

Q: How do you mitigate credential stuffing?
A: Enforce MFA, check submitted passwords against breach corpuses (e.g. HIBP's k-anonymity API), rate limit and lock accounts, and encourage unique passwords via password managers.

Q: What is an account lockout policy?
A: A rule that temporarily disables an account or login method after a threshold of failures, balancing brute-force defense with DoS-via-lockout risk.

Q: What is the difference between throttling and lockout?
A: Throttling adds progressive delay between attempts (still allows access); lockout blocks attempts entirely for a period after a threshold.

Q: What is a password breach corpus check?
A: Comparing a user's chosen password (or its hash prefix) against known breach databases to reject commonly reused or compromised passwords.

Q: What is zero trust architecture?
A: A security model that assumes no implicit trust based on network location, requiring continuous verification of identity, device, and context for every request.

Q: What is defense in depth?
A: It is layering multiple, independent security controls (e.g. WAF + input validation + output encoding + CSP) so failure of one does not fully compromise the system.

Q: What is fail-closed vs fail-open?
A: Fail-closed: a security control denies access when it cannot decide. Fail-open: it allows access. Security-critical features should default to fail-closed.

Q: What is the STRIDE threat model?
A: A categorization of threats into Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege, used to enumerate risks.

Q: What is the difference between DREAD and STRIDE?
A: STRIDE classifies what can go wrong per element; DREAD scores each threat on Damage, Reproducibility, Exploitability, Affected users, and Discoverability.

Q: What is attack surface?
A: The sum of all points where an attacker can interact with a system: endpoints, parameters, APIs, services, and the data each accepts.

Q: What is the principle of deny by default?
A: Authorizing only explicitly allowed actions, users, and origins, rather than allowing everything and trying to block known-bad patterns.

Q: What is allowlisting vs blocklisting?
A: Allowlisting permits only known-good inputs/values; blocklisting rejects known-bad patterns. Allowlisting is safer because it fails closed against novel attacks.

Q: What is a Web Application Firewall (WAF)?
A: A reverse-proxy or module that inspects HTTP traffic and applies rules to block common attacks (SQLi, XSS, path traversal) before they reach the application.

Q: What is a WAF not a replacement for?
A: Secure code and proper input validation: WAFs can be bypassed with encoding, parameter pollution, or novel payloads, and they add latency and false positives.

Q: What is a bot management solution?
A: It is a system that fingerprints and challenges (or blocks) automated clients based on behavior, TLS fingerprint, JS challenges, and reputation.

Q: What is a TLS downgrade attack?
A: It is when an attacker forces the client and server to negotiate a weaker cipher or protocol (e.g. SSL 3.0) that is vulnerable to known attacks.

Q: What is POODLE?
A: It is a Padding Oracle On Downgraded Legacy Encryption attack against SSL 3.0 that allowed attackers to decrypt portions of HTTPS cookies via padding-oracle attacks.

Q: What is Heartbleed?
A: It is a 2014 vulnerability in OpenSSL's heartbeat extension (CVE-2014-0160) that allowed reading server memory, exposing private keys and session tokens.

Q: What is a padding oracle attack?
A: An attack that uses differing error responses (valid vs invalid padding) to gradually decrypt ciphertext without knowing the key, against CBC-mode encryption with MAC confusion.

Q: What is a CRIME/BREACH attack?
A: Attacks that use compression-oracle side channels to recover secrets (e.g. CSRF tokens, session IDs) from the size of compressed HTTPS responses.

Q: What is HTTP/2 Rapid Reset (CVE-2023-44487)?
A: It is a DoS vulnerability exploiting HTTP/2 stream cancellation, allowing a single client to send many requests and immediately cancel them, overwhelming servers.

Q: What is a replay attack?
A: An attack that re-sends a previously captured valid request (e.g. an authenticated POST) to repeat an action, mitigated by nonces, timestamps, and one-time tokens.

Q: What is nonce reuse in token-based APIs?
A: Reusing a nonce lets an attacker replay the same request; nonces must be single-use and tracked server-side for the request lifetime.

Q: What is HMAC and why use it for webhooks?
A: HMAC signs the webhook body with a shared secret so the receiver can verify both integrity and authenticity of the message, preventing spoofed callbacks.

Q: What is constant-time string comparison used for in webhooks?
A: Verifying HMAC signatures in constant time prevents timing oracles that could leak the signature byte by byte.

Q: What is the importance of timestamp windows in signed requests?
A: Bounding the validity of a signed request (e.g. ±5 minutes) prevents captured signatures from being used indefinitely.

Q: What is an API key vs an OAuth token?
A: API keys are opaque long-lived identifiers identifying the calling application; OAuth tokens (often JWTs) are scoped, time-limited credentials that represent delegated user access.

Q: What is token leakage via logs?
A: Logging full requests can capture Authorization headers, cookies, or tokens, exposing them to anyone with log access; scrub sensitive headers before logging.

Q: What is the risk of JWT alg=none?
A: Older JWT libraries accepted alg=none and an unsigned token, allowing attackers to forge tokens. Libraries must enforce a strict allow-list of algorithms.

Q: What is JWT key confusion (HS vs RS)?
A: It is when a library, given a public RSA key, accepts it as the HMAC secret, letting an attacker sign forged tokens with the public key.

Q: What is token replay across services?
A: Tokens issued for one service being accepted by another, often due to broad audiences or shared signing keys; tokens must have explicit audience (aud) claims and services must validate them.

Q: What is a refresh token?
A: A long-lived credential used to obtain new short-lived access tokens without re-authentication, and it must be stored and rotated securely.

Q: What is the purpose of the aud (audience) claim?
A: It identifies the intended recipient of a token, preventing a token issued for service A from being replayed against service B sharing the same signing key.

Q: What is the purpose of the iss (issuer) claim?
A: It identifies who minted the token, allowing relying parties to accept tokens only from trusted issuers.

Q: What is the purpose of the nbf/exp claims?
A: nbf (not before) and exp (expiration) bound the time window during which a token is valid, limiting replay and damage from leaked tokens.

Q: What is a CSPRNG and why is it required for tokens?
A: A Cryptographically Secure Pseudo-Random Number Generator produces unpredictable values suitable for session IDs, nonces, and keys, unlike generic RNGs like rand() or Math.random().