46 questions

Web security interview questions and answers

Junior questions

  1. 1. What is OWASP Top 10 and how should you use that list?

    Answer

    OWASP Top 10 is a public ranking of the most common risk categories of web applications, updated periodically from real data. It is not an exhaustive checklist but a starting point for team training and prioritization. Categories include Broken Access Control, cryptographic failures, injection, insecure design, misconfiguration and vulnerable components. There is also a separate OWASP API Security Top 10, shifted toward authorization and endpoint inventory.

    Follow-up question: Which category most often takes first place and why?

  2. 2. How does authentication differ from authorization?

    Answer

    Authentication answers who you are: checking a password, a code from an app, a passkey. Authorization answers what you are allowed to do: whether you can read this document or delete a user. One does not work without the other: a user can be genuine but have no right to the action. Authorization is checked on the server for every request, not just by hiding a button in the interface.

    Follow-up question: Why is hiding a button in the UI not protection?

  3. 3. What is SQL injection and how do you defend against it?

    Answer

    SQL injection happens when user input is inserted into the query text and an attacker changes its structure, for example by adding ' OR 1=1 --. The main defense is parameterized queries, where values are passed separately from the SQL text and are never interpreted as code. An ORM helps, but raw queries and dynamic column names or ORDER BY remain a risk. Also: least privilege for the database user and input validation.

    Follow-up question: Why can't a parameter be used for a table name or sort direction?

  4. 4. What is XSS and what kinds does it have?

    Answer

    Cross-Site Scripting is the execution of someone else's JavaScript in the context of your site in the victim's browser. Stored XSS: malicious code is saved on the server, for example in a comment, and runs for everyone who opens it. Reflected: the code arrives in a request parameter and is immediately echoed in the response. DOM-based: a vulnerability in client code that writes untrusted data into the DOM, for example through innerHTML. The main defense is context-aware output escaping, safe APIs such as textContent, and CSP as a second line.

    Follow-up question: Why do frameworks such as React mostly protect against XSS, and where do holes remain?

  5. 5. What is CSRF and how do you defend against it?

    Answer

    Cross-Site Request Forgery makes the browser of a logged-in user send a request to your site from another site, and the browser adds the cookie itself. Defenses: a CSRF token that a malicious site cannot read, the cookie attribute SameSite=Lax or Strict, and checking the Origin and Referer headers. State-changing actions are not done through GET. An API that authenticates with an Authorization header rather than a cookie does not suffer from CSRF, because the browser does not add such a header automatically.

    Follow-up question: Does SameSite=Lax protect against all CSRF scenarios?

  6. 6. How should user passwords be stored correctly?

    Answer

    A password is never stored in plain text and never encrypted reversibly. What is stored is the result of a slow salted hash function: argon2id, bcrypt or scrypt. The salt is unique per password and prevents the use of precomputed tables. Slowness and memory cost make brute force expensive even after a database leak. Fast hashes like SHA-256 or MD5 are not suitable for passwords.

    Follow-up question: What is a pepper and how does it differ from a salt?

  7. 7. What does HTTPS give you and how does TLS work in broad terms?

    Answer

    HTTPS is HTTP over TLS. It gives three things: traffic encryption, integrity (data was not altered in transit) and server authenticity via a certificate. During the handshake the client verifies a certificate issued by a trusted authority, the parties agree on keys, and then data is encrypted symmetrically. Without HTTPS, passwords and cookies are visible on the network and a page can be changed on the way. The HSTS header tells the browser to always use HTTPS for the site.

    Follow-up question: What does the browser check in a certificate when it opens a site?

  8. 8. What is CORS and does it protect an API from attackers?

    Answer

    The same-origin policy does not let a script from one origin read responses from another. CORS is the mechanism by which a server explicitly allows the browser to do such reading for specified origins via headers such as Access-Control-Allow-Origin. It protects the user in the browser, not the server: curl or any script outside a browser ignores CORS. So API authorization cannot be built on CORS. Combining * with sending cookies is forbidden, and reflecting any Origin back is dangerous.

    Follow-up question: What is a preflight request and when does it occur?

  9. 9. What is a JWT, what does it consist of, and is it encrypted?

    Answer

    A JWT is a compact token of three parts: header, payload and signature, encoded in base64url. The payload is not encrypted, anyone can read it, so sensitive data is not put there. The signature guarantees the token was not changed and was issued by someone who holds the key. A valid token works until exp expires, and revoking it earlier is hard, so access tokens are made short-lived. The token is sent in Authorization: Bearer.

    Follow-up question: How does an HS256 signature differ from RS256 and when do you choose which?

  10. 10. Which security headers should a web application send?

    Answer

    Strict-Transport-Security enforces HTTPS. Content-Security-Policy restricts script sources and reduces XSS impact. X-Content-Type-Options: nosniff forbids the browser from guessing content type. frame-ancestors in CSP (or X-Frame-Options) protects against clickjacking. Referrer-Policy limits URL leakage, and Permissions-Policy turns off unneeded browser features. These are layers of defense that complement but do not replace secure code.

    Follow-up question: What is clickjacking and how does frame-ancestors protect against it?

Middle questions

  1. 1. Which items of OWASP API Security Top 10 2023 do you see most often in a backend API, and how does this list differ from the classic Top 10?

    Answer

    The most frequent: API1 BOLA, where an object is looked up by an id from the URL without an ownership check; API3 BOPLA, extra fields in the response or mass assignment in the request body; API5 BFLA, an admin function without a role check, often on another method or API version; API4 and API6, no limits and no protection of business flows from bots. The API list is shifted toward authorization and endpoint inventory rather than XSS or rendering, because an API has no browser UI.

    Follow-up question: How do you find forgotten old versions and staging endpoints (API9) in time?

  2. 2. A pentest found that when updating a profile a regular user became admin, and the response shows a password hash. What is this vulnerability and how do you fix it?

    Answer

    This is BOPLA: mass assignment on input and excessive fields on output. The controller copies the request body into an entity without a whitelist, and the client adds role: "admin", and on the response the whole entity is returned. Fix: separate input and output DTOs listing only allowed fields, validation that rejects unknown properties, and explicit response construction instead of serializing the model. Fields that change privileges are allowed only on a dedicated admin endpoint.

    Follow-up question: Why is a role check on the endpoint not enough if the role can be changed through the profile?

  3. 3. A user changed the id in the URL /orders/123 to /orders/124 and saw someone else's order. What is this and how do you fix it systematically?

    Answer

    This is IDOR, in OWASP API terms BOLA: the server checks that the user is logged in, but not that the object belongs to them. Fix: check the owner or permission on every object access, or better build it into the database query (WHERE id = ? AND owner_id = ?) or a common access layer, so you do not rely on a developer's memory. Unpredictable UUIDs instead of sequential ids make enumeration harder but do not replace permission checks. For regressions, write tests that try other users' ids.

    Follow-up question: How do you check a large API for BOLA automatically?

  4. 4. A colleague says an ORM protects against SQL injection. When is that not true?

    Answer

    An ORM protects only when values go in as parameters. If in a query builder or raw query a value is interpolated with a template string (where(name = '${name}')), that is an ordinary injection. The same goes for column names and the direction in ORDER BY that come from the client: they cannot be passed as parameters, so they are checked against a list of allowed values. In Prisma, $queryRawUnsafe is dangerous, while the tagged $queryRaw parameterizes interpolations automatically. Reviewing every raw query is mandatory.

    Follow-up question: How do you check code for SQL injection automatically?

  5. 5. A login on Express and Mongoose: an attacker gets in as admin without knowing the password. What request body could he have sent?

    Answer

    This is NoSQL injection through operators. If the code passes the body straight into the query User.findOne({ email, password }), the attacker sends JSON { "email": "[email protected]", "password": { "$ne": null } }, and the condition becomes true for any password. Defense: validate the type of input fields (a string, not an object) with a schema such as zod or class-validator, do not compare passwords through a database query but fetch the user by email and verify the hash in code, and if needed sanitize keys containing $.

    Follow-up question: Why is it important for a JSON API to reject unknown and nested fields?

  6. 6. A backend serves comments for an SPA. After a stored XSS incident, the frontend says it is the backend's problem and the backend says it is the frontend's. Who is right?

    Answer

    Responsibility is shared. The main defense is output escaping at the place of rendering, that is on the frontend: React escapes text by default, while dangerouslySetInnerHTML or innerHTML create a hole. The backend is responsible for validation, sanitizing the allowed HTML with a proven library if HTML is needed, the correct Content-Type and security headers, CSP and HttpOnly cookies, so session theft is harder. One layer is not enough, you need defense in depth.

    Follow-up question: Why should you not write an HTML sanitizer yourself with regexes?

  7. 8. A user provides a webhook URL, the service sends a request to it and shows the response. What vulnerability is this and how do you close it?

    Answer

    This is SSRF: the server can be made to reach internal addresses such as http://localhost, private networks or the cloud metadata address 169.254.169.254, and hand back the result. Defense: allow only https and an allow-list of hosts where possible; resolve DNS yourself and reject private, loopback and link-local addresses; do not follow redirects after the check; limit time and response size; keep such requests in an isolated network segment with no access to internal services. Do not show the response to the user raw.

    Follow-up question: Why is a blocklist by host string easy to bypass?

  8. 9. An endpoint accepts a zip, extracts the files and serves them by a link from the same domain. What are the risks?

    Answer

    Zip slip: names like ../../etc/x write files outside the target directory, so the path after normalization must stay within the folder. Zip bomb: a small archive expands into gigabytes, so you limit total size, file count and depth. Serving uploaded files from the main domain leads to stored XSS (HTML or SVG), so they are served from a separate domain or with Content-Disposition: attachment and X-Content-Type-Options: nosniff. The file type is checked by content, not by extension, and uploaded files are not executed.

    Follow-up question: Why can an uploaded SVG be an XSS vector?

  9. 10. How do you choose argon2id or bcrypt parameters for login, and what is a pepper?

    Answer

    Parameters are tuned so that one check takes about 100 to 500 ms on your hardware: argon2id with parameters from OWASP recommendations, or bcrypt with a cost of at least 10 to 12. They are raised over time and the password is rehashed on the next successful login. A pepper is a secret shared by the whole system, added to the password or hash and stored separately from the database, for example in a secrets manager. It helps when only the database leaked. A heavy hash also needs DoS protection: limits on login rate and concurrency.

    Follow-up question: Why does bcrypt truncate long passwords and how is that worked around?

  10. 11. By what paths do secrets leak from a service, and is it enough to delete .env from the repo in the next commit?

    Answer

    It is not enough: the file stays in git history, so the key is treated as compromised and rotated. Typical leak paths: git history, Docker image layers, environment variables in logs and in docker inspect, error messages with a connection string, CI logs, artifacts and client bundles that got variables without a prefix check. Defense: secret scanners in pre-commit and CI, a secrets manager, least-privilege keys with a short lifetime, masking in logs, separate keys per environment.

    Follow-up question: How do you check that a secret did not end up in a client JS bundle?

  11. 12. TLS is terminated at Nginx, and the app listens on localhost behind it. What should you pay attention to in the configuration?

    Answer

    Allow only TLS 1.2 and 1.3 with modern ciphers, enable HSTS, an HTTP to HTTPS redirect and automatic certificate renewal (Let's Encrypt). The app must know the original request was secure: Nginx passes X-Forwarded-Proto and X-Forwarded-For, and the app trusts these headers only from its own proxy, otherwise a client can forge them. Otherwise Secure cookies and absolute links will misbehave. The hop between Nginx and the app on the same host is protected by isolation, but across a separate network you need encryption.

    Follow-up question: Why is trusting X-Forwarded-For dangerous without proxy configuration?

  12. 13. What does HSTS do and what are the risks of includeSubDomains and preload?

    Answer

    The Strict-Transport-Security header tells the browser to use only HTTPS for the domain for max-age, which closes downgrade attacks and SSL stripping. includeSubDomains extends the rule to all subdomains, so a subdomain without HTTPS will stop opening. preload adds the domain to the browsers' built-in list, and undoing that later takes a very long time. So you enable it gradually: first a small max-age after checking all subdomains, and only then increase it.

    Follow-up question: Why does HSTS not protect on the first visit to a site?

  13. 14. In a multi-tenant SaaS on one database, customer A saw customer B's invoices. Where does the mistake usually hide and how do you make isolation reliable?

    Answer

    Typical holes: a query without a tenant_id condition, lookup by id without a tenant check, background jobs or cache without a tenant key, aggregations and exports. Relying on a developer to remember WHERE tenant_id is unreliable. Isolation is built into the access layer (a mandatory filter in the repository or ORM scope), the tenant comes from the authenticated context rather than a request parameter, and at the database level you enable Row Level Security as the last line. Add tests with two tenants that check cross-tenant access.

    Follow-up question: Why must the cache key also contain the tenant identifier?

  14. 15. Partners integrate with your API through keys. How do you design the key format, storage, verification and rotation?

    Answer

    The key is generated by a cryptographic generator, long enough, with a prefix that identifies the type and lets scanners find leaks. It is shown once, and the database stores only a hash (a fast SHA-256 is enough because the key has high entropy) and a short public prefix for lookup. For each key you set scopes and limits, an expiry and an owner. Rotation: two keys can be active at once so the client switches without downtime. Usage is logged and suspicious keys are revoked immediately.

    Follow-up question: Why do API keys not need a slow argon2 like passwords do?

  15. 16. A reporting service pulls data from your API hourly without a user. Which OAuth2 flow do you use?

    Answer

    Client credentials: the service as a client authenticates to the authorization server with its client_id and secret (or better a certificate or signed assertion) and receives a short-lived access token with the needed scopes. There is no user here, the token represents the service itself. The token is cached until it expires rather than requested on every call. The client secret is stored as a secret, rotated, and granted minimal scopes.

    Follow-up question: How does client credentials differ from authorization code?

  16. 17. The authorization code flow has state, nonce and code_verifier. What does each one protect against?

    Answer

    state binds the response to the request that this very user initiated and protects the redirect endpoint from CSRF. nonce is embedded in the id token and checked by the client, which protects against replay of the id token. code_verifier in PKCE proves that the code exchange is done by the same client that started the flow: an intercepted code without the verifier is useless. PKCE is now recommended for all clients, not only public ones.

    Follow-up question: Why is the implicit flow no longer recommended?

  17. 18. A user pressed 'Log out' in an app that signs in through Keycloak. What should happen on the client, in the backend and in the provider?

    Answer

    On the client you delete the local session and tokens from memory or cookies. In the provider you end the SSO session through the end-session endpoint (RP-initiated logout), otherwise the next login will pass without a password. Refresh tokens are revoked through the revocation endpoint. A JWT access token stays valid until exp, so its lifetime is kept short, and for critical operations revocation is checked through introspection or a denylist. You can also use back-channel logout so the provider notifies all applications.

    Follow-up question: What is back-channel logout?

  18. 19. An API accepts tokens from a shared realm, and a pentest got into the API with an id token. Why is this a problem and how do you fix it?

    Answer

    An id token is meant for the client to learn who logged in, not for calling an API. Its aud is the client, not your API, so an API that checks only the signature and iss accepts a token issued for any application in the realm. Fix: the API checks aud (or azp and scope) against its own identifier, accepts only access tokens of the right type, and tells them apart by claims such as typ. Use a separate audience per resource server.

    Follow-up question: How does an access token differ from an id token in content and purpose?

  19. 20. The security team found tokens, passwords and password reset links in the logs. How do you fix this systematically?

    Answer

    Log selectively, not 'the whole request and response'. Set up masking at the logger level by a list of sensitive keys (password, authorization, token, cookie) and never log the bodies of authentication requests. Reset links and tokens in URLs end up in proxy logs, so make them short-lived and single-use. Add tests that check no secrets appear in logs, and restrict access to the logs themselves and their retention. Whatever already got into logs is considered compromised and rotated.

    Follow-up question: Why are secrets in query parameters worse than secrets in headers?

  20. 21. How do you protect login and sensitive endpoints from brute force and abuse?

    Answer

    Rate limiting by several keys: IP, account and their combination, with growing delays or a temporary block. Permanently locking an account lets an attacker lock out other people's users, so delays and CAPTCHA when suspicious are preferred. MFA sharply lowers the risk even if the password is guessed. Identical responses and timing for existing and non-existing accounts do not reveal which emails are registered. Limits and logging are also put on password reset and code sending.

    Follow-up question: Why are limits by IP alone easy to bypass?

  21. 22. How are passkeys better than passwords, and what MFA methods exist?

    Answer

    A passkey is a cryptographic key pair based on WebAuthn: the private key never leaves the device, and the server stores only the public key. So there is no password to steal from a database or phish: authentication is bound to the site's domain. Other MFA methods: TOTP codes from an app, FIDO2 hardware keys (the most phishing resistant) and push confirmations. SMS codes are the weakest because of SIM swap and interception. Account recovery must be designed carefully, since it often becomes the weakest link.

    Follow-up question: Why can the account recovery process nullify MFA?

Senior questions

  1. 1. Design a Content-Security-Policy for a React admin panel. Why is unsafe-inline for scripts dangerous?

    Answer

    Start with default-src 'self' and open up only what is needed: script-src for your own domain, connect-src for the API, img-src, and frame-ancestors 'none' against clickjacking. unsafe-inline allows any inline script to run, which is exactly what an XSS injects, so CSP loses its point. Instead you use a nonce or hashes that the server generates for each response. First enable Content-Security-Policy-Report-Only, collect reports, then move to enforcement.

    Follow-up question: How does CSP get along with third-party analytics scripts?

  2. 2. A colleague proposes removing CSRF tokens because browsers now default to SameSite=Lax. When is he right and when not?

    Answer

    Lax blocks the cookie on cross-site POSTs and subrequests, so the main class of attacks is closed. But there are limits: the cookie is still sent on top-level GET navigation, so state-changing GET endpoints remain vulnerable. Requests within the same site but across different origins, such as from a sibling subdomain, are not filtered by SameSite. Old browsers and third-party clients behave differently, and Chrome gives a two minute window for new cookies without an explicit attribute. So tokens or an Origin check remain a useful second layer.

    Follow-up question: How does a site differ from an origin?

  3. 3. Code resolves a domain and checks the IP is not private, then makes the request. Is that enough against SSRF?

    Answer

    No, because of DNS rebinding and TOCTOU. The attacker controls DNS: the first answer gives a public IP and passes the check, and at connection time the client resolves again and gets 127.0.0.1. Fix: resolve once and connect to exactly that verified IP, passing the original Host, or check the address at the socket level, in a custom lookup or through an outbound proxy. Also check every redirect anew and cover IPv6 variants and decimal or hexadecimal forms of addresses.

    Follow-up question: Why is an outbound proxy with an allow-list more reliable than a check in application code?

  4. 4. A service generates image previews by calling ImageMagick through exec with a user-provided file name. What injections are there, and is escaping quotes enough?

    Answer

    Command injection: exec starts a shell, so a name like a.png; rm -rf / runs an extra command. There is also argument injection: a name starting with - is interpreted as an option of the utility. Quotes do not solve the problem. The right way: use execFile/spawn without a shell and with an argument array, put -- before file names, generate your own file names on disk instead of user-supplied ones, and better still call a library instead of a process. Run with minimal privileges in a restricted environment.

    Follow-up question: How is execFile safer than exec in Node?

  5. 5. After another service's database leak, your login received 2 million attempts from 40 thousand IPs, 1 to 3 attempts per account. What do you do?

    Answer

    This is credential stuffing: login and password pairs from someone else's leak. Per-IP limits are useless because the IPs are spread out. What helps: MFA or passkeys, checking passwords against lists of exposed ones (for example via the k-anonymity API of Have I Been Pwned), limits per account and by anomalies (new devices, bot behavior), CAPTCHA or proof-of-work when suspicious, and notifying users about a login from a new device. Do not reveal whether an account exists: identical responses and timing on failure.

    Follow-up question: How does k-anonymity work in checking exposed passwords?

  6. 6. Compare RBAC, ABAC and ReBAC on the example of a document system: a user sees their own documents, their team's documents and shared ones.

    Answer

    RBAC grants rights by roles (editor, admin): simple and clear, but roles multiply and rules about specific objects are hard to express. ABAC decides by attributes of the user, resource and context (department, document status, time): flexible, but rules are hard to audit. ReBAC derives access from a graph of relationships (owner, team member, a document in a folder that was shared), as in Google Drive or Zanzibar-like systems, and describes shared access naturally. In practice they are combined: roles for broad rights, relationships for objects, attributes for exceptions.

    Follow-up question: How does ReBAC answer the question 'who has access to this document'?

  7. 7. You enabled Row Level Security to isolate tenants. It works in tests, but in production under load clients occasionally see foreign data. What do you suspect?

    Answer

    Most likely the tenant is passed through a session setting (SET app.tenant_id), and the connection pool returns a connection carrying the previous request's tenant. Solution: SET LOCAL inside a transaction so the value resets when it ends, set at the start of each one. Other pitfalls: the table owner and superuser bypass RLS unless FORCE ROW LEVEL SECURITY is set, and the application must not connect as the owner role. PgBouncer in transaction pooling mode needs exactly a per-transaction setting.

    Follow-up question: How do you debug an RLS policy when it silently hides rows?

  8. 8. What are typical mistakes in JWT verification on a backend, according to RFC 8725 and practice?

    Answer

    You must check more than the signature. Mistakes: accepting alg: none or the algorithm from the token header instead of a predefined list, mixing HS and RS keys, no check of exp, nbf, iss and aud, trusting a kid that points to an arbitrary URL, decoding without verifying (decode instead of verify), and storing the signing secret weak or hardcoded. Tokens meant for another purpose, such as an id token, must not be accepted as an access token. It is better to use a proven library with explicit parameters.

    Follow-up question: The algorithm confusion attack: how does it work and why does an algorithm list block it?

  9. 9. Where should an SPA keep tokens? A colleague stores access and refresh tokens in localStorage because HttpOnly cookies are 'inconvenient'.

    Answer

    Anything in localStorage can be read by any script on the page, so one XSS exposes both tokens, including the long-lived refresh token. A more reliable pattern is BFF: a small backend on your domain performs the OAuth exchange, keeps the tokens on the server, and gives the browser only an HttpOnly, Secure, SameSite cookie session. Then tokens are inaccessible to JS, but you need CSRF protection. If a token must still be in the browser, keep it in memory, make it short-lived and rotate the refresh token.

    Follow-up question: What are the drawbacks of a BFF compared with tokens in the browser?

  10. 10. After introducing refresh token rotation with reuse detection, users with two tabs are massively logged out. Why?

    Answer

    With rotation each refresh token is single-use, and reuse of an old one is treated as theft and the whole token family is revoked. Two tabs refresh at the same time with the same refresh token, the second loses the race, and the system sees 'reuse'. Solution: coordination on the client (one tab refreshes, the others wait via a lock or BroadcastChannel), and on the server a small grace window in which the previous token is still accepted, which gives idempotency on network retries. Also check that the new pair definitely reached the client.

    Follow-up question: What do you do with the token family on a real reuse?

  11. 11. The billing service trusts the X-User-Id header set by the gateway. Through SSRF in another service an attacker called billing directly. What went wrong?

    Answer

    The internal network was considered trusted, so billing accepted any X-User-Id without checking the source. One SSRF made it possible to bypass the gateway and substitute someone else's identity. Fix: services verify a cryptographically proven identity, not a header. That means a signed token (the user's JWT passed along, or a service token), mTLS between services or network policies that admit only known services to billing. This is the zero trust idea: the network is not trust.

    Follow-up question: How do you pass a user's identity between services while keeping verification?

  12. 12. What is mTLS and when should you use it between services?

    Answer

    In ordinary TLS only the server presents a certificate. In mutual TLS both sides have certificates and verify each other, so the server knows exactly which client service called it, and traffic is encrypted. This suits service to service communication well. The difficulty is issuing and rotating certificates: so teams use an internal CA, short-lived certificates and automation, or a service mesh that does it transparently. Without automatic rotation an expired certificate becomes a cause of downtime.

    Follow-up question: How do you avoid downtime from an expired internal certificate?

  13. 13. npm audit shows 47 vulnerabilities, the team has ignored them for a long time, and the news is full of attacks through packages. What do you do?

    Answer

    Do not drown in noise: prioritize by reachability and exploitability, because many vulnerabilities are in dev dependencies or in code that is never called. Pin versions through a lock file and reproducible installs (npm ci), automate updates (Dependabot or Renovate) and scanning in CI. Against supply chain attacks it helps to vet new packages and maintainers, avoid arbitrary postinstall scripts from unknown packages, keep dependencies minimal, and use an SBOM and artifact signatures. Publishing and CI tokens are protected, and secrets are kept out of the build environment.

    Follow-up question: How does typosquatting differ from dependency confusion?

  14. 14. On Friday evening you learn that the JWT signing secret has been in a contractor's public GitHub repo for three days. What do you do?

    Answer

    Assume compromise: tokens can be forged. First containment: rotate the signing key, which invalidates all issued tokens (users log in again), with a transition period through kid if needed. Then investigation: check logs for suspicious tokens, unusual permissions and actions that started in this period. Remove the secret from the repo but treat it as already copied. Notify those responsible and, if needed, users or a regulator. After that a postmortem: how the secret got out and how to prevent a repeat.

    Follow-up question: How do you rotate a JWT signing key without mass logout?

Train these questions

Study the cards, answer by text or voice and get an AI grade. Needs a signed in account.

Answer out loud and get graded

Here you get the questions with model answers. In the ShortLesson app you answer yourself, by text or voice, and AI grades the answer against the rubric and asks a follow-up, like a real interviewer.

The app is coming to the stores soon.

Other topics