First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Web Application Testing
During an authorized web assessment you find a reflected cross-site scripting flaw in a search parameter. Which payload encoding most reliably bypasses a filter that blocks the literal characters < and > while the response is written inside an HTML attribute value?
- Use a javascript: URI inside a new href attribute created by breaking out of the attribute Correct answer.
- Percent-encode the angle brackets as %3C and %3E in the request parameter
- Double-encode the angle brackets so the filter decodes them after the browser parses
- Submit the payload as UTF-7 so the server transcodes it before filtering
Explanation
When the injection point sits inside an attribute value, breaking out of the attribute and adding an event handler or a javascript: URI avoids the need for literal angle brackets entirely. The browser parses the resulting markup, so the handler fires without any < or > characters. Encoding tricks only help if the filter and the browser disagree on decoding order, which is not guaranteed here.
Question 2Web Application Testing
A login form returns the same generic error message and the same HTTP status for unknown usernames and wrong passwords, but the response time for unknown usernames is consistently about 200 ms lower. What is the most accurate characterization?
- The timing difference enables username enumeration and should be reported with measured evidence Correct answer.
- The timing difference is irrelevant because timing attacks cannot be automated reliably
- The form is not vulnerable to username enumeration because messages and status codes are identical
- The form is vulnerable to SQL injection because the timing gap proves a database query differs
Explanation
Uniform messages and status codes address content-based enumeration, but a statistically consistent timing gap still leaks whether the account exists. The finding should be reported with repeated measurements, sample sizes, and variance so the client can reproduce it. Timing attacks are automatable given enough samples, and a timing gap alone does not prove SQL injection.
Question 3Web Application Testing
An application stores a JWT in a cookie and validates the signature server-side. Which additional control most directly limits the impact of a stolen token?
- Adding the user's username to the token payload as a custom claim
- Increasing the HMAC key length to 512 bits for the signing algorithm
- Short token lifetime combined with server-side revocation of the session identifier Correct answer.
- Switching the token format from JWT to a signed opaque reference token only
Explanation
A stolen bearer token remains valid until it expires or is revoked, so short lifetimes plus a revocation mechanism bound to a server-side session record bound the exposure window. Key length and payload claims do not help once the token is stolen, because the attacker presents a validly signed token. Opaque tokens help only if they are also revocable and short-lived.
Question 4Web Application Testing
You are testing an endpoint that accepts a JSON body and returns detailed database errors. Which technique best confirms a SQL injection in a numeric JSON field without damaging data?
- Insert a semicolon followed by a shell command to test for command injection
- Submit a payload that drops the users table to observe the error message
- Send a very large integer to trigger an overflow and read the stack trace
- Append a boolean expression such as AND 1=1 versus AND 1=2 and compare response content Correct answer.
Explanation
Boolean-based differential testing compares true and false conditions to confirm injection while remaining read-only. Error messages may corroborate the finding but destroying a table is destructive and out of scope. Shell metacharacters and integer overflow test different vulnerability classes.
Question 5Web Application Testing
Which HTTP response header, when correctly configured, instructs modern browsers to block a page from loading scripts from origins not explicitly allowed?
- Strict-Transport-Security with a long max-age
- Content-Security-Policy with a script-src directive Correct answer.
- X-Content-Type-Options: nosniff
- Referrer-Policy: no-referrer
Explanation
Content-Security-Policy with script-src restricts which origins may supply executable script, giving a strong mitigation against script injection. nosniff addresses MIME sniffing, HSTS forces HTTPS, and Referrer-Policy controls referrer leakage, none of which restrict script origins.
Question 6Web Application Testing
A web app lets users upload profile images and serves them from a path under the same origin. Which combination most effectively prevents stored script execution via uploaded files?
- Requiring users to accept a terms-of-service checkbox before upload
- Compressing uploaded images to reduce size before storage
- Storing uploads in a database blob column instead of the filesystem
- Renaming files with random UUIDs and serving them with a strict Content-Type and nosniff Correct answer.
Explanation
Serving user files from the application origin is dangerous if the browser interprets them as HTML or script. Forcing a safe Content-Type plus nosniff, and avoiding attacker-controlled extensions, prevents the browser from executing the content. Compression, storage location, and policy checkboxes do not change how the browser interprets the response.
Question 7Web Application Testing
Which condition makes an application vulnerable to server-side request forgery through an image-fetch feature?
- The server caches fetched images in a shared CDN edge location
- The client browser fetches the image directly from the user-supplied URL
- The image URL is stored in a database and rendered in an img tag
- The server fetches a user-supplied URL without validating the resolved destination address Correct answer.
Explanation
SSRF occurs when the server itself requests a user-controlled URL and can be steered to internal services or metadata endpoints. Validation must occur on the resolved address, not just the hostname string, to defeat DNS rebinding and redirects. Client-side fetching and caching do not by themselves create server-side request capability.
Question 8Web Application Testing
An API uses numeric object identifiers in paths such as /api/invoices/1042. Requests for another tenant's invoice return 200 with data. Which class of flaw is this?
- Insecure direct object reference in a static file path
- Broken object-level authorization Correct answer.
- Server-side template injection
- Cross-site request forgery
Explanation
The server fails to check that the authenticated principal owns the requested object, which is broken object-level authorization, often called IDOR. CSRF concerns forged state-changing requests, and template injection concerns server-side template evaluation. Static file path traversal is a different issue from API object ownership.
Question 9Web Application Testing
A site reflects user input into an HTML page but escapes <, >, &, ", and '. Which residual risk most commonly remains?
- Injection into an existing script block or event handler where HTML escaping is irrelevant Correct answer.
- Clickjacking through missing frame-ancestors
- Reflected content being cached by a shared proxy
- Cookie theft through the HttpOnly flag being absent
Explanation
HTML entity encoding protects text and attribute contexts, but it does not make data safe inside JavaScript, CSS, or URL contexts. If input lands in a script block or event handler, an attacker can still break out using syntax that entity encoding does not neutralize. Caching, cookie flags, and framing are separate concerns.
Question 10Web Application Testing
Which testing approach best detects blind SQL injection in a parameter whose output is never shown to the tester?
- Union-based payloads that append a second result set to the original query
- Time-based payloads that introduce a measurable delay conditional on a true expression Correct answer.
- Reflected payloads that rely on the response echoing the input
- Error-based payloads that rely on verbose database error messages
Explanation
When no output or error text is returned, a conditional time delay provides an observable signal that the injected expression executed. Reflected, error-based, and union techniques all depend on some form of visible output channel. Time-based inference is slower but works without any reflected data.
Question 11Web Application Testing
A web server returns directory listings for folders lacking an index file. Why is this a security concern beyond information disclosure?
- It bypasses authentication on all sibling applications
- It automatically enables remote code execution through directory traversal
- It disables TLS for the affected virtual host
- It can reveal backup files and source archives that are then directly downloadable Correct answer.
Explanation
Directory listing exposes file names that are not linked anywhere, including backups, editor swap files, and archives containing source or credentials. Those files can then be fetched directly, turning a listing into a source-code or secret disclosure. Listing does not itself cause code execution, disable TLS, or bypass authentication.
Question 12Web Application Testing
During a test you observe that the Set-Cookie header for a session cookie lacks the Secure attribute while the site is served over HTTPS. What is the most precise impact?
- The cookie is stored in the browser indefinitely without expiry
- The cookie is shared across all subdomains of the parent domain
- The cookie may be transmitted over a plaintext HTTP request if one is made to the same host Correct answer.
- The cookie value is readable by JavaScript running on the page
Explanation
Without Secure, the browser may attach the cookie to an HTTP request to the same host, exposing it to network interception. JavaScript readability is controlled by HttpOnly, subdomain scope by the Domain attribute, and persistence by Max-Age or Expires. Those are distinct attributes from Secure.
Question 13Web Application Testing
Which request pattern most directly tests for cross-site request forgery in a state-changing endpoint that uses cookie authentication?
- Submitting the request with an oversized body
- Submitting the request with an expired session cookie
- Submitting the request with a modified JSON content type
- Submitting the state-changing request from a different origin without the anti-CSRF token Correct answer.
Explanation
CSRF testing checks whether the server accepts a state-changing request that lacks a valid anti-CSRF token when it originates from another site. If the request succeeds without the token, the endpoint is vulnerable. Expired cookies, content-type changes, and oversized bodies test other behaviors such as session handling and input limits.
Question 14Web Application Testing
A single-page application loads user-controlled HTML into a container using innerHTML. Which mitigation most directly addresses the resulting DOM cross-site scripting risk?
- Set the X-Frame-Options header to DENY
- Enable HSTS with a one-year max-age
- Add the HttpOnly flag to the session cookie
- Assign text through textContent or use a sanitizer that produces safe DOM nodes Correct answer.
Explanation
innerHTML parses markup and can create script-bearing nodes from attacker input. Using textContent keeps data as text, and a context-aware sanitizer removes dangerous markup while preserving safe formatting. Cookie flags, HSTS, and framing headers do not stop DOM-based script execution.
Question 15Web Application Testing
Which finding is the strongest indicator that an application is vulnerable to HTTP request smuggling?
- The server sets a long Cache-Control max-age on static assets
- The server responds with gzip-compressed HTML
- The server returns a 404 for paths that do not exist
- The front-end and back-end disagree on message length because both Content-Length and Transfer-Encoding are accepted Correct answer.
Explanation
Request smuggling arises when intermediaries parse message boundaries differently, typically when Content-Length and Transfer-Encoding are both present or conflicting. That desynchronization lets an attacker prefix the next request in the queue. Missing paths, caching directives, and compression are unrelated to message framing.
Question 16Web Application Testing
Which technique is appropriate for testing whether a parameter is vulnerable to local file inclusion without reading sensitive system files?
- Request a directory listing of the web root
- Request /etc/shadow and inspect the returned hashes
- Request a remote URL to test for SSRF instead
- Request a known harmless file such as a bundled readme and check for its contents Correct answer.
Explanation
Proof of file inclusion requires showing that an arbitrary path is read, and a harmless bundled file demonstrates this without touching sensitive data. Reading password hashes crosses into unnecessary exposure. SSRF and directory listing are different vulnerability classes.
Question 17Web Application Testing
An application uses a templating engine and reflects the string {{7*7}} as 49 in the response. What does this most directly indicate?
- Client-side cross-site scripting in an HTML attribute
- XML external entity injection
- SQL injection in a numeric parameter
- Server-side template injection in the evaluated context Correct answer.
Explanation
When a template expression is evaluated server-side and the arithmetic result appears in the response, the input reached a template evaluation context. That is the classic confirmation of server-side template injection. XSS would execute in the browser, and SQL or XXE would produce different observable behavior.
Question 18Web Application Testing
Which control most effectively mitigates clickjacking for a legacy application that must remain frameable by one trusted partner origin?
- X-Frame-Options: DENY on all responses
- Removing all cookies from the application
- Content-Security-Policy frame-ancestors naming only the trusted partner origin Correct answer.
- A JavaScript framebusting script that sets top.location
Explanation
frame-ancestors lets you allow framing only by specified origins, which fits the requirement to remain frameable by one partner. DENY would break that requirement, and framebusting scripts are bypassable and unreliable. Cookie removal does not address framing.
Question 19Web Application Testing
Which of the following best describes a second-order SQL injection?
- The database returns two result sets that must be merged
- Malicious input is stored and later concatenated into a query in a different code path Correct answer.
- The injection only works when the query is executed twice in the same request
- The payload must be URL-encoded twice to reach the database
Explanation
Second-order injection occurs when stored data is trusted later and concatenated into a query without parameterization. The original submission may be safely stored, so testing only the input endpoint misses the flaw. Re-execution, double encoding, and multiple result sets describe unrelated mechanics.
Question 20Web Application Testing
A password reset flow emails a link containing a token. Which design weakness most directly enables account takeover?
- The link is delivered over HTTPS
- The token expires after 30 minutes
- The reset form requires the user to confirm the new password twice
- The token is a predictable value derived from the user's email address Correct answer.
Explanation
If the reset token can be predicted from public information such as the email address, an attacker can forge a valid link for any account. Expiry, transport security, and confirmation fields are good practices that do not create takeover risk. Tokens must be generated with a cryptographically secure random source.
Question 21Web Application Testing
Which testing step best verifies that an access control check is enforced server-side rather than only in the user interface?
- Inspect the page source for hidden admin menu items
- Disable JavaScript in the browser and reload the page
- Check whether the admin link uses a different CSS class
- Replay the privileged request directly with a lower-privileged session and observe the response Correct answer.
Explanation
Server-side authorization must be verified by sending the request with a principal that should be denied and confirming the server rejects it. Hiding UI elements or disabling JavaScript only tests client-side presentation. The server response is the authoritative signal.
Question 22Web Application Testing
An application accepts XML input and resolves external entities. Which impact is most characteristic of this configuration?
- Disclosure of local files and interaction with internal network services Correct answer.
- Execution of arbitrary JavaScript in the victim's browser
- Bypass of TLS certificate validation
- Persistence of session cookies across subdomains
Explanation
XML external entity processing lets an attacker define entities that read local files or make server-side requests, leading to file disclosure and SSRF-like access to internal services. Browser script execution, TLS validation, and cookie scope are unrelated to XML entity resolution.
Question 23Web Application Testing
You want to determine whether an application is vulnerable to open redirection after login. Which observation confirms it?
- The redirect parameter accepts a relative path within the application
- The redirect parameter is ignored when it is empty
- The login page sets a new session cookie after authentication
- The redirect parameter accepts an absolute URL to an external host and the response issues a 302 to that host Correct answer.
Explanation
Open redirection is confirmed when the server honors an attacker-supplied absolute URL and sends the browser to that external destination. Relative paths staying on the same host are the intended safe behavior. Session cookies and empty-parameter handling do not demonstrate redirection control.
Question 24Web Application Testing
Which condition makes a deserialization endpoint a realistic remote code execution risk during a web assessment?
- The application compresses serialized data with gzip before transmission
- The application deserializes attacker-controlled data with a library that has usable gadget chains on the classpath Correct answer.
- The application serializes its own session data before storing it in a database
- The application signs serialized data with HMAC-SHA256 and verifies it
Explanation
Unsafe deserialization becomes exploitable when untrusted input reaches a deserializer and the classpath contains gadget chains that trigger side effects during object reconstruction. Serializing trusted server-side state, compressing data, and verifying an HMAC are not by themselves exploitable. Signature verification actually prevents tampering.
Question 25Web Application Testing
Which practice most reduces the risk of testing activity disrupting a production web application during an authorized assessment?
- Using the production database backup as the test target without approval
- Testing only after business hours without notifying the client
- Running all payloads at maximum concurrency to finish quickly
- Agreeing on scope, test windows, and destructive-test exclusions with the client in writing beforehand Correct answer.
Explanation
Documented scope, timing, and explicit exclusions for destructive tests let the tester avoid actions that could harm availability or data. High concurrency increases disruption risk, unannounced testing may violate the rules of engagement, and using backups without approval is out of scope.
Question 26Web Application Testing
During a web assessment you find that the application sets a session cookie with the SameSite attribute omitted while state-changing requests rely solely on that cookie. Which attack does this configuration most directly enable?
- Cross-site request forgery against authenticated users Correct answer.
- Server-side request forgery through the cookie value
- SQL injection in the authentication query
- Reflected cross-site scripting in the login form
Explanation
When a browser attaches a cookie to cross-site requests because SameSite is absent, an attacker page can trigger state-changing actions as the victim. The cookie value itself does not create script execution, server-side fetches, or SQL injection, so the realistic impact is CSRF.
Question 27Web Application Testing
A REST endpoint accepts a JSON body and echoes the value of a 'name' field into an HTML response header. Which payload class is most appropriate to test whether header injection is possible?
- Carriage return and line feed sequences embedded in the field value Correct answer.
- A base64-encoded blob longer than the header buffer
- A Unicode homoglyph replacing each ASCII letter
- A JSON object nested ten levels deep in the field
Explanation
CRLF sequences are the canonical probe for header injection because many servers concatenate user input into header values. If the sequence is not stripped, the attacker can terminate the header and add new ones or split the response.
Question 28Web Application Testing
You are reviewing a JWT-based authentication scheme. The server validates the signature but accepts any value in the 'alg' header, including 'none'. What is the most direct consequence for an attacker?
- Brute-forcing the HMAC secret faster than offline
- Replaying tokens after their expiry timestamp
- Forging tokens with arbitrary claims and no valid signature Correct answer.
- Decrypting the contents of other users' tokens
Explanation
If the server honors the 'none' algorithm, an attacker can craft a token with any claims and omit the signature entirely. The server then treats the token as valid, granting whatever privileges the forged claims request.
Question 29Web Application Testing
A web application reflects the value of a query parameter inside a JavaScript block on the page, and the value is escaped only for HTML entities. Which payload style is most likely to achieve script execution?
- A CSS expression embedded in a style attribute
- An HTML tag with an onerror handler pointing to an external script
- A string that closes the existing JavaScript literal and appends a statement Correct answer.
- A meta refresh tag with a data URI target
Explanation
HTML-entity escaping does not stop a value placed inside a script context from terminating the surrounding string literal. The attacker supplies characters that close the quote and add executable JavaScript, bypassing the HTML-focused encoding.
Question 30Web Application Testing
An application's password reset endpoint accepts an email address and always returns the same message. Which additional observation most strongly indicates user enumeration is still possible?
- Response timing differs measurably between registered and unregistered addresses Correct answer.
- The endpoint sets a new session cookie on each request
- The endpoint rejects requests without a CSRF token
- The endpoint returns HTTP 200 for all requests
Explanation
Uniform response bodies do not prevent enumeration if processing time differs based on whether the account exists, for example due to database lookups or email dispatch. Measuring timing across many requests reveals the side channel.
Question 31Web Application Testing
During testing you notice the application returns detailed stack traces including framework versions when an invalid parameter is supplied. Which risk does this most directly represent?
- Cross-site scripting stored in the error log
- Information disclosure that aids targeted exploitation Correct answer.
- Remote code execution through the error page
- Authentication bypass via the error handler
Explanation
Verbose error output exposes internal paths, library versions, and query fragments that help an attacker select exploits. It is an information disclosure finding, even though it does not by itself execute code or bypass authentication.
Question 32Web Application Testing
A web application uses an ORM that parameterizes queries, but a search feature concatenates the sort column name into the SQL string. Which testing step best confirms the vulnerability?
- Sending a single quote inside the search term and checking for a generic error page
- Supplying a crafted column expression and observing a database error or altered sort order Correct answer.
- Adding a semicolon to the search term and looking for a redirect
- Appending a comment sequence to the search term and measuring response size
Explanation
The injectable position is the identifier, not a value, so a quote in the search term will be parameterized and harmless. Supplying a column expression tests whether the identifier is concatenated and interpreted by the database.
Question 33Web Application Testing
You are assessing an XML upload feature and want to confirm whether external entity expansion is possible. Which observation most directly confirms the vulnerability?
- The response includes contents of a local file referenced by a declared entity Correct answer.
- The response returns the same XML document that was submitted
- The upload endpoint enforces a 1 MB size limit
- The parser rejects the document because the DTD is missing
Explanation
External entity expansion is confirmed when an entity defined in the DTD resolves to local file contents or an out-of-band request. Seeing that data in the response proves the parser resolved the external reference.
Question 34Web Application Testing
A single-page application stores an access token in localStorage and sends it in an Authorization header. Which residual risk remains despite the absence of cookies?
- TLS interception becomes possible without a certificate
- The token cannot be validated by the server
- CSRF becomes trivially exploitable without SameSite
- Any successful XSS can read the token and impersonate the user Correct answer.
Explanation
Tokens in localStorage are readable by any script running in the origin, so a single XSS flaw escalates to full session theft. Cookie-based CSRF defenses do not apply because the token is not sent automatically.
Question 35Web Application Testing
Which HTTP response header most directly instructs browsers to restrict a page from being embedded in a frame on another origin?
- X-Content-Type-Options set to nosniff
- Referrer-Policy set to no-referrer
- Strict-Transport-Security with a long max-age
- Content-Security-Policy with frame-ancestors Correct answer.
Explanation
The frame-ancestors directive in CSP specifies which origins may embed the page, addressing clickjacking. HSTS, nosniff, and referrer policies govern transport, MIME sniffing, and referrer leakage respectively.
Question 36Web Application Testing
An application exposes a debug endpoint that returns environment variables. Which finding does this most directly support during a web assessment?
- Exposure of secrets such as API keys and database credentials Correct answer.
- Cross-site scripting through the JSON response
- Open redirection via the endpoint path
- Server-side request forgery from the debug route
Explanation
Environment variables commonly contain credentials and API keys, so an exposed debug route is a high-impact information disclosure. The other issues would require separate evidence of reflection, outbound fetching, or redirect parameters.
Question 37Web Application Testing
You want to test whether an application's authorization check on an object can be bypassed by manipulating the HTTP method. Which approach is most appropriate?
- Send the request twice in rapid succession to detect race conditions
- Add a trailing slash to the resource path and compare status codes
- Change the Accept header to application/xml and inspect the body
- Replay the same request with GET, PUT, and PATCH and compare responses Correct answer.
Explanation
Method-based authorization bypass occurs when a control is applied to one verb but not others, so replaying the operation with alternative verbs reveals the gap. Race conditions, path normalization, and content negotiation address different classes of issues.
Question 38Web Application Testing
A web server returns a 302 redirect to a URL taken from a 'next' parameter without validating the host. Which impact is most characteristic of this flaw?
- Bypass of TLS certificate validation
- Execution of arbitrary code on the web server
- Phishing by redirecting users to an attacker-controlled site after login Correct answer.
- Disclosure of the server's private key material
Explanation
An unvalidated redirect target lets an attacker craft a link on the trusted domain that forwards victims to a malicious site, which is useful for credential phishing. It does not grant code execution, key disclosure, or certificate bypass.
Question 39Web Application Testing
During a test of a file upload feature you find that uploaded files are stored under a web-accessible directory and the original extension is preserved. Which follow-up test most directly determines whether the upload leads to code execution?
- Upload a file with a double extension and inspect the Content-Type response header
- Upload a large file and observe whether the server truncates it
- Upload a file containing HTML and check whether it is served with nosniff
- Upload a script with an executable extension and request it via the web server Correct answer.
Explanation
Code execution depends on whether the server executes files in the upload directory, so uploading an executable extension and requesting it directly is the decisive test. The response reveals whether the file was interpreted or merely served as static content.
Question 40Web Application Testing
Which testing technique is most suitable for detecting a blind server-side request forgery in a parameter that expects a URL?
- Send an oversized value and observe whether the server returns a 413 status
- Append a null byte to the parameter and compare response lengths
- Point the parameter at a collaborator host you control and watch for inbound requests Correct answer.
- Inject a single quote into the parameter and look for a database error
Explanation
Blind SSRF produces no visible response, so the reliable signal is an out-of-band interaction with a listener you control. A callback to your collaborator host confirms the server fetched the supplied URL.
Question 41Web Application Testing
An application uses client-side routing and enforces role checks only in the front-end router. Which test most directly demonstrates the missing server-side control?
- Intercept the login request and observe the token format
- Inspect the bundled JavaScript for hardcoded role names
- Disable JavaScript in the browser and reload the landing page
- Call the privileged API endpoint directly with a low-privilege session token Correct answer.
Explanation
Front-end checks are bypassed whenever the API is called directly, so invoking the privileged endpoint with a low-privilege token tests the real enforcement point. A successful response proves the server never verified the role.
Question 42Web Application Testing
Which condition is required for a stored cross-site scripting payload to affect other users of a web application?
- The payload is shorter than the database column limit
- The payload is submitted over an unencrypted connection
- The application uses HTTP/2 for delivery
- The stored value is later rendered in a context that does not encode it Correct answer.
Explanation
Stored XSS requires the persisted input to be output into a page without context-appropriate encoding so the browser interprets it as markup or script. Transport protocol and payload size do not determine execution.
Question 43Web Application Testing
A web application includes a parameter that is passed to an operating system command without sanitization. Which payload characteristic is most useful for confirming command injection without causing harm?
- A SQL comment sequence appended to the value
- A long random string that forces a server error
- An XML entity declaration referencing a local file
- A metacharacter followed by a benign command whose effect is observable Correct answer.
Explanation
Appending a shell metacharacter with a harmless command such as a DNS lookup or sleep produces an observable effect that confirms injection without destructive action. The other payloads target different vulnerability classes.
Question 44Web Application Testing
During an assessment you observe that the application accepts a serialized object in a cookie and deserializes it server-side. Which factor most increases the likelihood of remote code execution?
- The cookie being transmitted without the HttpOnly attribute
- A gadget chain available in the loaded libraries that triggers during deserialization Correct answer.
- The serialized data being base64-encoded
- The application using a recent TLS version
Explanation
Deserialization becomes exploitable for code execution when classes on the classpath form a gadget chain that runs code during object reconstruction. Encoding and transport attributes do not provide the execution primitive.
Question 45Web Application Testing
Which request is most useful for testing whether an application is vulnerable to HTTP verb tampering on an administrative endpoint?
- Send the request with an uncommon method such as TRACE or a lowercase verb Correct answer.
- Send the request with a very large body to exhaust memory
- Send the request with a spoofed User-Agent header
- Send the request twice with the same CSRF token
Explanation
Verb tampering exploits access controls that match only specific methods, so unusual or differently cased verbs can slip past filters. Observing a successful privileged response confirms the bypass.
Question 46Web Application Testing
An application reflects a parameter into a JavaScript event handler attribute such as onclick. Which encoding is required to safely place the value there?
- HTML entity encoding of angle brackets only
- Base64 encoding of the parameter value
- JavaScript string and HTML attribute encoding appropriate to the context Correct answer.
- URL encoding of the entire parameter value
Explanation
Values inside event handler attributes require both JavaScript encoding to prevent breaking out of the string and HTML attribute encoding to keep the attribute intact. Single-layer encoding leaves a breakout path.
Question 47Web Application Testing
Which evidence most reliably confirms that a web application is vulnerable to local file inclusion rather than merely reflecting the parameter?
- The response sets a new cookie on each request
- The response contains content from a known system file requested via traversal sequences Correct answer.
- The response echoes the parameter value inside an HTML comment
- The response returns a 500 status when the parameter is empty
Explanation
LFI is confirmed when traversal sequences cause the server to read and return a file outside the intended directory. Echoing the parameter or changing status codes does not demonstrate file access.
Question 48Web Application Testing
A web application uses a Content Security Policy that allows 'unsafe-inline' in script-src. Which statement best describes the security implication?
- The policy enforces HTTPS for all subresources
- Inline scripts and event handlers can execute, weakening XSS defenses Correct answer.
- The policy blocks all inline styles from loading
- The policy prevents framing by other origins
Explanation
Allowing 'unsafe-inline' in script-src permits inline script blocks and event handler attributes, which removes much of CSP's protection against injected scripts. The directive does not govern transport, styling, or framing.
Question 49Web Application Testing
During a test you find that an API returns full records for other tenants when the tenant identifier in the path is changed. Which control is missing?
- Server-side object-level authorization tied to the authenticated identity Correct answer.
- Encryption of the response body in transit
- Rate limiting on the API endpoint
- Input validation of the tenant identifier format
Explanation
Changing an identifier to reach another tenant's data succeeds when the server trusts the supplied identifier without verifying ownership against the session. The fix is object-level authorization checks on every request.
Question 50Web Application Testing
Which action best verifies that an application's logout function invalidates the session server-side rather than only clearing the cookie?
- Check whether the logout page sets a new CSRF token
- Confirm the logout response returns a 302 redirect
- Replay the captured session cookie after logout and check whether it is still accepted Correct answer.
- Inspect the cookie's expiry attribute in the browser
Explanation
If the server invalidates the session, replaying the old cookie after logout must fail authentication. A cookie cleared only on the client leaves the server-side session valid and the replay succeeds.