Skip to content

Application Security Engineer interview questions

100 real questions with model answers and explanations for Junior candidates.

See a Application Security Engineer resume example

Practice with flashcards

Spaced repetition · Hunter Pass

Questions

code-reviewhttpqueries

I would trace the untrusted value from its source through every transformation to the network sink before deciding whether it is vulnerable.

  • Mark `req.query.url` as the source because the caller can change query parameters without using the normal UI.
  • Follow assignments, helper calls, parsing, validation, and redirects until the value reaches `fetch`, Axios, or another outbound request API.
  • Record controls on the path, then verify they constrain the final destination after DNS resolution and redirects rather than only checking the original string.

Why interviewers ask this: The interviewer checks whether you can reason about a concrete source-to-sink path instead of judging one line in isolation.

code-review

I would treat every value controlled outside the application's trust boundary as untrusted, even if a framework parsed it first.

  • Request paths, query parameters, bodies, headers, and cookies are direct client-controlled sources.
  • Database rows, queue messages, uploaded files, and partner API responses remain untrusted when another user or system can influence them.
  • A TypeScript type or JSON parser changes representation but does not establish that a value is safe or authorized.

Why interviewers ask this: A strong answer recognizes indirect sources and does not confuse parsing or typing with trust.

code-reviewsecure-code-review

A sink is an operation where attacker-controlled data can gain a dangerous interpretation or affect a protected resource.

  • SQL execution, shell process creation, template rendering, and `innerHTML` can interpret data as code or syntax.
  • Filesystem writes, redirects, outbound HTTP calls, and deserializers can cross important application boundaries.
  • The same value may be harmless in a log message but dangerous in a shell command, so I classify the sink by its actual API and context.

Why interviewers ask this: The interviewer evaluates whether you identify dangerous operations by behavior and context rather than by variable names.

validation

Validation decides whether input fits the application's rules, while output encoding prevents valid data from becoming syntax in its destination.

  • A comment may legitimately contain `<`, quotes, or ampersands, so rejecting every special character would damage normal text.
  • When rendering into HTML text, the template engine must encode characters for that HTML context.
  • If the same value enters a URL or JavaScript string, it needs the encoder or safe API for that different context.

Why interviewers ask this: A strong answer separates business validation from context-specific protection at the sink.

sqlqueriesschema

I would map a small set of public sort values to fixed SQL identifiers instead of inserting the caller's string into the query.

  • For example, map `date` to `created_at` and `total` to `total_cents`, rejecting every other value.
  • Database placeholders bind values, not table or column identifiers, so parameterization alone does not solve this case.
  • The mapping also prevents accidental access to internal columns that happen to have valid SQL names.

Why interviewers ask this: The interviewer checks whether you know where an allowlist is appropriate and where value binding has limits.

reactformsapi

The API must enforce the role rule because a caller can bypass the React form and send requests directly.

  • Validate the server-side value against the exact roles allowed for this operation, not every role known to the system.
  • Authorize who may assign a role separately, because a valid value such as `admin` can still be forbidden for the caller.
  • Add an API test that sends `admin` and an unknown value as a normal user and expects rejection.

Why interviewers ask this: The interviewer checks whether you place validation and authorization at the server boundary.

databaseapi

A trust boundary appears at each transition where components have different identities, permissions, or control over data.

  • Browser input crosses into the API, so the API authenticates, validates, and authorizes it independently of the UI.
  • A queued job crosses from the API to a worker, so the worker verifies message shape and does not assume every producer is correct.
  • The API and worker cross into the database under service identities whose permissions should match their separate duties.

Why interviewers ask this: A strong answer places concrete checks and identities at internal as well as external boundaries.

least-privilegeaccess-control

I would separate the capabilities so code that generates reports cannot delete accounts or modify unrelated records.

  • Give the reporting path a database identity limited to the required views or `SELECT` operations.
  • Put deletion behind a distinct service method and authorization check rather than exposing a general database client to every module.
  • Run background converters and parsers under an unprivileged operating-system account with access only to their working directory.

Why interviewers ask this: The interviewer evaluates whether you translate least privilege into concrete application, database, and process boundaries.

sqlormapi

I would return a stable generic error to the client and keep actionable details in restricted server logs.

  • The response should omit SQL text, table names, filesystem paths, stack frames, and environment values.
  • Log the exception with a correlation ID, request route, and safe context so developers can investigate without exposing internals.
  • Map expected failures such as duplicate email to a specific safe response instead of leaking the raw database exception.

Why interviewers ask this: A strong answer preserves debuggability while preventing application internals from reaching users.

formsvalidation

Security checks should apply to the same normalized value the sensitive operation will use.

  • A path check before URL decoding may miss `%2e%2e/`, while the filesystem later receives `../`.
  • Parse and normalize once with the platform library, reject invalid or ambiguous forms, then use that checked result.
  • Avoid repeated decoding because double-encoded input can change meaning after the first validation step.

Why interviewers ask this: The interviewer checks whether you understand validation-order bugs caused by inconsistent representations.

queries

The code mixes caller-controlled data into SQL syntax, so the email can change the query structure.

  • Replace concatenation with the driver's placeholder, such as `WHERE email = $1`, and pass `email` in the values array.
  • Do not repair it with manual quote escaping because database modes and edge cases make that fragile.
  • Add a regression test with a quote-containing email and confirm it remains one bound value rather than altering the statement.

Why interviewers ask this: The interviewer expects a language-specific parameterized fix and a test that proves code-data separation.

mongodbnosql-injectionrisk-management

The client may inject MongoDB operators instead of supplying the simple field values the application expects.

  • Input such as `{"password": {"$ne": null}}` changes query semantics when arbitrary objects reach `find`.
  • Build a new filter from validated scalar fields, for example `{ email: validatedEmail }`, rather than forwarding the request object.
  • Reject keys beginning with `$`, but treat that as backup protection rather than a substitute for an explicit schema.

Why interviewers ask this: A strong answer recognizes operator injection and constructs a safe query object instead of vaguely sanitizing JSON.

python

I would avoid the shell and pass a fixed executable plus separate arguments to `subprocess.run`.

  • Use an argument list such as `["convert", input_path, output_path]` with `shell=False` so metacharacters stay inside one filename argument.
  • Generate server-controlled paths and enforce file rules before starting the process.
  • Run the converter with low operating-system privileges, a timeout, and resource limits to contain parser failures.

Why interviewers ask this: The interviewer checks whether you remove command interpretation and add practical containment around the child process.

frameworks

The application treats user input as Jinja template source, which can expose data or execute dangerous template expressions.

  • Keep the template fixed in application code and pass the user value as data, such as `render_template("message.html", message=value)`.
  • Leave Jinja autoescaping enabled for HTML output, but do not mistake autoescaping for protection against server-side template injection.
  • Test an expression-shaped value and confirm it appears as text rather than being evaluated.

Why interviewers ask this: A strong answer distinguishes untrusted template source from ordinary data rendered by a fixed template.

injectionldap-injection

Unescaped input can add LDAP filter operators and change which directory entries match.

  • Concatenating a username into `(&(uid=` plus input plus `)(active=true))` lets characters such as `*`, `(`, and `)` affect syntax.
  • Use the LDAP library's filter-escaping or filter-builder API for assertion values rather than writing a generic backslash replacement.
  • Keep the directory service account read-only and scoped to the required subtree to limit impact if a query is wrong.

Why interviewers ask this: The interviewer checks whether you use LDAP-specific construction and understand that generic escaping is context-dependent.

joinsendpointspython

The joined path may still escape the report directory, especially when `name` is absolute or contains parent segments.

  • Prefer accepting a report ID and looking up a server-owned filename instead of exposing filesystem names to callers.
  • If names are required, resolve both paths with `pathlib.Path.resolve` and require the target to be relative to the resolved report root.
  • Review symlink handling and open the checked target without following links where the platform supports it, then test absolute and encoded parent paths.

Why interviewers ask this: A strong answer identifies path traversal in a concrete Python API and considers both canonical paths and symlinks.

archive-traversal

It must verify every archive entry resolves inside the chosen extraction directory before writing it.

  • Reject absolute entry names and parent traversal, then compare each normalized destination with the normalized extraction root.
  • Treat archive-created symlinks as dangerous because a later entry can write through them outside the directory.
  • Apply limits on entry count and total expanded size so a valid path check does not leave a decompression denial of service.

Why interviewers ask this: The interviewer evaluates whether you review archive extraction beyond a superficial filename check.

I would treat the uploaded bytes as hostile and constrain validation, storage, and parser execution separately.

  • Enforce request and expanded-size limits, check the file signature with a maintained parser, and reject malformed or encrypted files the feature does not support.
  • Store the upload under a generated name in private quarantine rather than a web-served or executable directory.
  • Run parsing in an isolated low-privilege worker with time and memory limits, then expose only the parsed result after authorization.

Why interviewers ask this: The interviewer checks whether you secure a parser-facing upload beyond trusting its filename and media type.

java-deserialization

Native Java deserialization can instantiate attacker-selected object graphs whose methods trigger dangerous gadget behavior.

  • A classpath containing a usable gadget chain can turn `readObject` into code execution before application validation runs.
  • Prefer a simple format such as JSON mapped to a narrow data class and validate its fields against a schema.
  • If legacy serialization cannot be removed immediately, apply a strict `ObjectInputFilter` allowlist and isolate the operation.

Why interviewers ask this: The interviewer checks whether you understand gadget execution and can name a safer Java-specific alternative.

yamlyaml-deserialization

With modern PyYAML, `yaml.load` takes an explicit `Loader`, and that loader determines which YAML tags and Python types may be constructed; `yaml.safe_load` uses `SafeLoader`.

  • For untrusted YAML, use `yaml.safe_load` or `yaml.load(..., Loader=yaml.SafeLoader)`, then validate the resulting data against the expected schema.
  • Do not use `yaml.unsafe_load` or `UnsafeLoader` on untrusted input because they permit Python-specific object construction that can trigger dangerous behavior.
  • Do not classify every `yaml.load` call the same way: inspect its loader and any custom constructors, and still enforce input size limits.

Why interviewers ask this: A strong answer identifies the explicit loader as the security decision and keeps safe parsing separate from schema validation.

Locked questions

  • 21

    An Express preview route calls `res.send(`<p>${req.query.message}</p>`)`. What vulnerability do you see?

    queriesvulnerabilities
  • 22

    A support ticket title is saved in the database and later passed to React `dangerouslySetInnerHTML` on the staff dashboard. What would you change?

    reactreact-xssdatabase
  • 23

    A single-page app reads `location.hash` and passes it to `insertAdjacentHTML` for a navigation label. Why is this DOM XSS?

    domdom-xssxss
  • 24

    Why is one generic `escapeHtml` helper unsafe for every browser output context?

    generics
  • 25

    What does a basic Content Security Policy add to an application with correct XSS defenses?

    xsscsp
  • 26

    A cookie-authenticated profile route accepts POST requests without a CSRF token. Why is that risky?

    csrftokenscookies
  • 27

    Does an API using an `Authorization: Bearer` header always need CSRF tokens?

    authcsrftokens
  • 28

    How would you review CORS code that reflects any request `Origin` and enables credentials?

    cors
  • 29

    A page loads a pinned third-party script from a CDN without an `integrity` attribute. What browser protection would you add?

    dependencies
  • 30

    During an Express review, Helmet disables `frameguard` and the CSP has no `frame-ancestors`. What risk would you report?

    clickjackingrisk-management
  • 31

    A route checks that `req.user` exists before deleting any project ID. What security check is missing?

  • 32

    How would you structure a login handler so internal failure reasons do not become user-enumeration signals?

  • 33

    A login handler returns `user not found` before hashing the submitted password. What issue would you raise?

    passwordscryptography
  • 34

    A product allows at most three signed-in devices per user. How would you implement concurrent-session invalidation?

    sessionsconcurrency
  • 35

    When should application code rotate a session identifier besides initial login?

    sessions
  • 36

    What is wrong with using `jwt.decode(token)` as proof that an API caller is authenticated?

    jwttokensjwt-verification
  • 37

    An Express admin router calls `router.use(requireAdmin)` after one route has already been registered. What would you change?

  • 38

    How would you structure authorization checks so a newly added route does not accidentally allow everyone?

    authidentity-access
  • 39

    A GraphQL resolver returns `db.document.findUnique({ where: { id: args.id } })` to any logged-in user. What is missing?

    graphqlgraphql-authorization
  • 40

    How do broken object-level and broken function-level authorization differ in an API review?

    authidentity-accessapi
  • 41

    What is your basic workflow when reviewing a small pull request for application-security bugs?

    code-review
  • 42

    How would you write a simple Semgrep rule for calls to Python `subprocess.run` with `shell=True`?

    semgreppython
  • 43

    When would a Semgrep taint rule be better than a single-pattern rule?

    semgrep
  • 44

    What does CodeQL add when a vulnerability spans multiple functions?

    vulnerabilitiescodeql
  • 45

    How do SAST, DAST, IAST, and SCA differ when reviewing an application?

    sastdastsca
  • 46

    Why should an SCA check use the dependency lockfile and built artifact, not only `package.json`?

    dependenciesnpmpackaging
  • 47

    You find an API key hardcoded in a repository. Why is deleting the line not enough?

    api
  • 48

    How would a junior engineer use OWASP ASVS during review of a new login feature?

    owaspasvs
  • 49

    What makes a useful security regression test for a fixed authorization bug?

    authidentity-accessregression
  • 50

    A SAST result says `req.headers.authorization` reaches a shared logging helper. How would you validate it?

    authvalidationsast
  • 51

    A Node.js signup route validates usernames with `/^([a-z]+)+$/` on caller-controlled input. What would you change?

    formsvalidation
  • 52

    A Java upload endpoint parses user XML with a default `DocumentBuilderFactory`. What would you review?

    endpoints
  • 53

    A support tool writes ticket subjects directly into CSV cells that staff open in a spreadsheet. What issue would you raise?

    spreadsheetsspread
  • 54

    A Go download handler checks strings.HasPrefix(filepath.Clean(path), uploadRoot). Why can traversal remain?

  • 55

    A FastAPI avatar route accepts any UploadFile whose content_type starts with image/. What would you fix?

    frameworks
  • 56

    A Node.js profile route calls `lodash.set(profile, req.body.path, req.body.value)`. What would you look for?

  • 57

    An Express report route calls exec("wkhtmltopdf " + req.body.url + " out.pdf"). What is the smallest safe redesign?

  • 58

    A FastAPI login route writes `f"login failed for {username}"` to a plain-text audit log. What would you test and change?

    frameworks
  • 59

    A Python password-reset route creates a six-digit token with `random.randint` and accepts it for 30 minutes. What would you change?

    passwordstokenspython
  • 60

    A Go service sets `tls.Config{InsecureSkipVerify: true}` on its payment API client. What would you recommend?

    tlscryptographyapi
  • 61

    Burp shows a search term inside value="..." on staging. How would you validate attribute-context XSS safely?

    xssvalidationappsec-tools
  • 62

    How would you use Caido to confirm a stored XSS report in a support-note field?

    xss
  • 63

    A cookie-authenticated WebSocket accepts upgrades without checking `Origin`. How would you validate the risk safely?

    validationcookiesrisk-management
  • 64

    A GET /profile/email/confirm endpoint changes state and the session cookie is SameSite=Lax. How would you test CSRF?

    csrfsessionscookies
  • 65

    An authenticated staging response passes through a CDN without an explicit cache policy. How would you test for a cross-user cache leak?

    caching
  • 66

    A webhook tester may have SSRF. How would you validate it without probing internal hosts?

    validationssrfwebhooks
  • 67

    The webhook tester blocks `127.0.0.1` but follows redirects. What bounded follow-up test would you run?

    networkingwebhooks
  • 68

    A login page accepts returnUrl. How would you test open redirect behavior with Burp and a browser?

    appsec-tools
  • 69

    A checkout iframe listens for postMessage and checks only event.data.type. How would you validate the browser risk?

    validationrisk-management
  • 70

    You are asked to run an authenticated ZAP scan against staging. How would you keep it safe and useful?

  • 71

    The login form treats Alice@example.com and alice@example.com differently. What security checks would you run?

    forms
  • 72

    A password-reset email builds its link from the Host header. How would you test and fix it?

    passwords
  • 73

    A TOTP code is accepted twice during the same 30-second window on staging. How would you test and fix replay handling?

  • 74

    Logout is a GET endpoint and can be triggered by an external image. Is that worth reporting?

    endpoints
  • 75

    A Java JWT verifier accepts both RS256 and HS256 with one key variable. What would you review?

    jwt
  • 76

    Two internal APIs use tokens from the same identity provider. How would you test audience validation?

    tokensvalidationapi
  • 77

    A normal user can call `POST /admin/users/bulk-disable` even though the admin button is hidden. How would you test and fix this BFLA?

  • 78

    After an administrator disables a staging user, that user's existing bearer token still calls `GET /api/profile`. How would you test and fix this?

    tokensapi
  • 79

    A GraphQL User type exposes salary, but the resolver only checks login. How would you test field authorization?

    authidentity-accessgraphql
  • 80

    A profile update API binds the full JSON body to a User model. What authorization test would you add?

    authidentity-accessapi
  • 81

    Semgrep flags `hashlib.md5` in a Python static-asset ETag helper. How would you triage it?

    semgreppython
  • 82

    Write the scope for a Semgrep rule that detects Express child_process.exec with request data. What would you include?

    semgrep
  • 83

    A CodeQL query misses a custom getHeader wrapper used before a redirect. What bounded change would you make?

    queriescodeql
  • 84

    Snyk reports a critical parser CVE, but the service never imports the parser directly. How would you prioritize it?

    vuln-management
  • 85

    Dependabot opens 14 separate patch PRs that modify one npm lockfile. How would you reduce risk and noise?

    npmpackagingdependency-resolution
  • 86

    Trivy flags CVE-2026-1234 in an Alpine package, while Alpine marks its build not affected. What would you do?

    vuln-management
  • 87

    OSV-Scanner reports a Go module that appears only in go.sum. How would you validate the finding?

    validation
  • 88

    What regression test would you add after fixing SQL injection in Express getOrder?

    sqlsql-injectioninjection
  • 89

    In `GET /accounts/{accountId}/keys`, where is the BOLA boundary and what integration test proves the fix?

    integrationobject-authorization
  • 90

    A new Semgrep rule finds 180 results, including generated clients and tests. How would you tune it before blocking CI?

    semgrep
  • 91

    A HackerOne report matches a bug fixed last week but not yet deployed. Is it a duplicate?

    deployment
  • 92

    A bounty researcher reports stored XSS visible only to one support administrator. How would you rate it?

    xss
  • 93

    A researcher claims command injection but provides only a 10-second response delay. What safe evidence would you request?

    injection
  • 94

    How would you write a developer ticket for confirmed IDOR in GET /documents/{id}?

  • 95

    A bounty patch removes public source maps after they exposed client-side source code and a test API credential. How would you retest it?

    source-mapsapi
  • 96

    A bug-bounty report uses 5,000 requests to show a possible rate-limit bypass, outside program rules. How would you handle it?

  • 97

    Where would you place Semgrep, CodeQL, and ZAP in CI for a 20-repository team?

    semgrepcodeql
  • 98

    A service needs a temporary Snyk exception for one CVE. What must the exception contain?

    vuln-managementerror-handling
  • 99

    A developer says a CodeQL finding is impossible because the route is internal. How would you respond?

    codeql
  • 100

    What evidence would you require before closing a patched SSRF report?

    ssrf