CS FundamentalsHardProduct-company security interview
An API uses self-contained JWT access tokens that are valid for 24 hours and are verified only by signature. A user's laptop is stolen and the account is disabled. What is the weakness, and the common mitigation?
- A. None; JWTs are revoked automatically when the account is disabled
- B. The token still verifies until it expires; use short-lived access tokens with revocable refresh tokens (or a deny-list checked on use)
- C. JWTs cannot be signed, so anyone can forge them
- D. The server must store every JWT in a session table, which removes all benefit
Correct answer: B. The token still verifies until it expires; use short-lived access tokens with revocable refresh tokens (or a deny-list checked on use)
Stateless tokens trade revocation for scalability. Keeping access tokens short (minutes) bounds the exposure, and refresh tokens, which are checked against the server, can be revoked.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A token-bucket rate limiter holds up to 10 tokens and refills 2 tokens per second; it starts full. A client fires requests as fast as…
- main has A-B-C. feature1 branched from C with commits D-E, and feature2 branched from E with commits F-G. feature1 is abandoned, but…
- A developer edits a tracked file app.py, creates a new file util.py, and runs git commit -a -m "update". What is committed?
- A CI job runs git clone --depth 1 on a large repository. Which statement is correct?
- Assertion (A): Raising average server CPU utilisation from 50% to 95% to save cost usually makes response times much worse. Reason (R): In…
- In 30 days a service had 4 incidents with total downtime of 6 hours. What are its mean time between failures (uptime-based) and its…