Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
Security & accessibilityMiddleOccasionalRisk analysis

Which risks and test oracles matter most for session management with malicious and malformed input?

Answer

Prioritize the risk that a malformed session token is accepted and mapped to an elevated or unintended default role, rather than rejected outright, since a parser that fails open is far more dangerous than one that simply errors. Focus on session management with malicious and malformed input. Use 'malformed session tokens never fall back to an elevated default' as the oracle, checked against truncated tokens, extra bytes, wrong encoding, and tokens with tampered signatures. Cover the specific failure path where a parser treats an unrecognized-but-not-rejected token as a valid low-privilege session that still retains cached elevated data. Keep every malformed-token variant and the resulting session state logged so the exact fallback path can be reproduced. Release only when every malformed or malicious token is rejected outright, with no default role or cached data surviving the failure.

Strong answer includes

  • explicit risk and test oracle for session management
  • tests that malformed tokens never fall back to elevated defaults
  • covers parser fail-open behavior specifically
  • measurable evidence and residual-risk statement

Practical example

A malformed session cookie with an extra trailing null byte was silently accepted by the session parser and treated as a valid but unrecognized session, defaulting to a guest role that still had read access to cached account data. The team ranked cookie-parsing robustness as the top risk and used 'malformed session tokens never fall back to elevated defaults' as the oracle.

#security#accessibility#session-management

Sources

OWASP Web Security Testing GuideOWASP · Web application security test coverageOWASP API Security Top 10 — 2023OWASP · Authorization, authentication, resource consumption and API-specific risks