SSRF, CSRF, and Deserialization

An application gives you three places to submit data. One field accepts a web address and promises to retrieve the resource. An account form changes a user’s contact details. A third endpoint accepts a saved object and reconstructs it for later use. This episode explains how SSR…

An application gives you three places to submit data. One field accepts a web address and promises to retrieve the resource. An account form changes a user’s contact details. A third endpoint accepts a saved object and reconstructs it for later use.

All three accept attacker-controlled input, but that fact alone doesn’t tell you what kind of security failure you’re looking at. To decide what evidence matters, ask two questions. Who acts on the input, and which trust boundary does that action cross?

This lesson addresses the part of PenTest+ objective 4.5 that explicitly includes server-side request forgery, cross-site request forgery, and deserialization attacks. That mapping establishes why these subjects belong in this season, but it doesn’t mean every web flaw belongs in this episode. Our boundary is narrower. We’re distinguishing three mechanisms, tracing the trust each one abuses, and choosing evidence that supports a finding without expanding an authorized test into unrelated systems.

Server-side request forgery, or SSRF, occurs when attacker-controlled input causes a server to make an unintended outbound or internal request. The important actor is the server. Imagine the application’s URL-fetch feature is supposed to download a public image. You supply a destination, the application server receives it, and that server attempts the connection. If the feature can be influenced to reach a destination that the application wasn’t meant to contact, the trust failure sits between attacker-controlled destination data and the server’s ability to make requests.

The server’s position matters. It may have network reach or access to service interfaces that an external user doesn’t have directly. Modern service and control APIs can amplify the potential impact because a request from a trusted application environment may reach capabilities that aren’t exposed in the same way to the user. That doesn’t prove every URL field is vulnerable, and it doesn’t justify probing every address the server might reach. It tells you why the server’s request behavior is the evidence you need to examine carefully.

Cross-site request forgery, or CSRF, has a different actor and a different source of trust. Here, an attacker causes a user’s browser to submit an unwanted authenticated request. The browser may already hold the state that identifies the user to the target application. If the application accepts a sensitive action without adequately distinguishing an intended request from a forged one, the browser can carry the unwanted request with that authenticated context.

Notice what has changed. In SSRF, the application server is induced to contact another destination. In CSRF, the user’s browser sends an unwanted action to an application where the user has authenticated state.

Both names contain request forgery, but they aren’t the same flaw viewed from opposite ends. The initiators, trusted capabilities, expected evidence, and affected boundaries are different. Calling SSRF merely CSRF from the server hides the very distinction you need to test.

Deserialization isn’t primarily about who sends a web request. Serialization represents structured data or objects in a form that can be stored or transferred. Deserialization reconstructs that representation. The security concern appears when an application unsafely handles attacker-controlled serialized data and that reconstruction enables attacker-controlled behavior.

The important interpreter is the component rebuilding or acting on the object. A file upload or object endpoint isn’t vulnerable just because it accepts structured data. You need evidence that unsafe reconstruction changes behavior across a security boundary.

That gives you a practical classification rule. If attacker-controlled destination data makes the server issue an unintended request, think SSRF. If a user’s authenticated browser is induced to perform an unwanted action, think CSRF.

If a component reconstructs attacker-controlled serialized data in an unsafe way, think deserialization. The shared appearance of attacker input doesn’t make the mechanisms interchangeable. Each depends on a different trust assumption, so a correction aimed at one doesn’t automatically correct the others.

Now return to the authorized application with its three endpoints. Before sending anything, turn each suspected flaw into a prediction. For the URL-fetch API, predict evidence of a request originating from the application environment.

For the account-change form, predict that an unwanted request submitted through your own authenticated browser could alter a permitted test account. For the object-upload endpoint, predict an observable change tied to reconstruction of the supplied representation. A prediction prevents a surprising response from becoming a finding merely because it looks unusual.

Authorization shapes those predictions. Confirm which application and endpoints are in scope, which test accounts you may use, when testing is allowed, and what operational constraints apply. Also identify dependencies.

A URL-fetch feature may contact another service, an account form may trigger downstream processing, and an uploaded object may enter a separate reconstruction workflow. If you don’t know whether those connected systems are included, clarification is the next professional action. The application being in scope doesn’t silently authorize every destination it can reach.

For the URL-fetch API, a bounded validation can use an endpoint controlled for the engagement and approved for receiving the application’s request. Submit its address through the fetch feature and compare the result with your prediction. Evidence received at that controlled destination may support the conclusion that the application server made an outbound request influenced by your input. An application response saying that a download succeeded is weaker on its own. It might reflect cached data, an error-handling problem, or a message generated before any network connection occurred.

Even a confirmed outbound request doesn’t establish every possible SSRF impact. It supports a specific boundary failure under the tested condition. Reaching for an unrelated internal service would add operational risk and might leave the authorized target boundary. If the lower-impact callback already establishes that the server follows attacker-influenced destinations, preserve that evidence and determine whether stronger validation is both necessary and explicitly permitted. Potential reach should be described as potential until evidence and scope support something more definite.

For the account-change form, use an account and action authorized for the test. Choose a reversible, low-impact change rather than something destructive. The expected evidence isn’t simply that the form accepts a request. Ordinary authenticated use proves that already. The relevant question is whether an unwanted request can be caused through the user’s browser while that browser carries the authenticated state, and whether the application accepts the action in that context.

Suppose the contact detail changes after your own test browser processes the controlled request. That observed state change can support the CSRF hypothesis when it matches the predicted mechanism. A copied request sent directly by a testing tool may show that the endpoint lacks some validation, but it doesn’t by itself demonstrate the browser-mediated condition you’re trying to establish. The evidence has to connect the authenticated browser, the unwanted request, and the accepted action. Otherwise, you may be describing a related observation rather than a validated CSRF finding.

The object-upload endpoint needs the same discipline. Start with a benign serialized representation permitted by the application and establish normal behavior. Then make a controlled change designed to reveal whether attacker-controlled properties influence reconstruction. Compare the resulting application behavior with the baseline.

An upload acceptance message proves only that the server received something. A parsing error proves that a parser rejected or failed on something. Neither observation, by itself, establishes unsafe deserialization or attacker-controlled behavior.

If the modified representation produces an approved, low-impact effect that can be tied to reconstruction, you have stronger evidence. If it only causes a generic failure, several explanations remain possible. The format might be wrong. The endpoint might expect another representation.

A prerequisite could be missing. The data might never reach the reconstruction component. Troubleshoot those possibilities before claiming a security boundary failure. A tool’s warning or a server error is an observation to investigate, not a substitute for mechanism-based verification.

This is where the three mechanisms demand different evidence. An outbound callback from the application environment supports the SSRF path, but it says nothing about whether a browser can submit an unwanted authenticated action. A changed account setting may support CSRF, but it doesn’t show that serialized objects are reconstructed unsafely. A controlled reconstruction effect may support unsafe deserialization, but it doesn’t demonstrate unintended server-to-server reach. One output can look dramatic and still be irrelevant to the actual hypothesis.

Conflicting results should send you back to assumptions before they send you toward a more intrusive test. If the callback never arrives, verify that you used the authorized destination, that it was available during the test, and that the feature actually attempted a fresh fetch. If the account setting doesn’t change, check whether the browser was authenticated, whether the chosen action was allowed for that account, and whether the request reached the intended test environment. If object behavior is unchanged, confirm the expected format, endpoint, prerequisites, and reconstruction path.

These checks separate an unsupported hypothesis from a failed test arrangement. They also prevent an absence of evidence from becoming an automatic declaration that no flaw exists. A blocked connection, stale result, wrong target, insufficient test privilege, or malformed representation can all leave you with uncertainty. Record that uncertainty plainly. The responsible conclusion may be that the attempted validation was inconclusive under the tested conditions, followed by the specific information or permission needed to continue.

The misconception that SSRF is just CSRF from the server would lead you to collect the wrong proof. Imagine observing that the URL-fetch endpoint contacts your controlled listener. If you apply the misconception, you might start looking for a logged-in victim or an account change. Neither is necessary to explain the observed server request.

The server’s network action is the relevant behavior. Conversely, a browser submitting an unwanted account update doesn’t become SSRF merely because a server eventually processes the request. The browser’s authenticated context is the trust being abused.

Deserialization exposes the same problem with loose labels. Every web request is eventually interpreted in some way, but that doesn’t make every input flaw a deserialization attack. The defining question is whether attacker-controlled serialized data is being reconstructed unsafely and enabling controlled behavior. If you can’t connect the observation to that reconstruction process, keep investigating or narrow the statement. Precise classification improves remediation because the application owner can focus on the boundary that actually failed instead of treating all attacker-controlled input as one undifferentiated problem.

Consider a second pass through the three endpoints after an initial test produces incomplete evidence. The URL-fetch API displays a success message, but your controlled receiver records nothing. The account form rejects a direct request from a testing tool, but you haven’t tested the browser-mediated condition.

The object endpoint returns an internal error after an upload. It would be easy to report three findings. In fact, you have three observations with important gaps.

For the fetch API, the missing request weakens the predicted SSRF evidence. Verify the receiver, timing, destination, and whether the application uses an existing result. If those checks don’t explain the discrepancy, report the behavior as unresolved rather than inventing a server request.

For the account form, rejection of a direct tool request doesn’t prove the browser case safe or vulnerable. Test only the authorized browser workflow and compare it with the stated hypothesis. For the object endpoint, preserve the error details available within scope, but don’t equate a crash or parsing failure with unsafe reconstruction.

The least-impactful next action differs in each case because the evidence gap differs. You may need a fresh controlled callback for the first, a properly bounded browser condition for the second, and confirmation of the expected object format for the third. Repeating the same payload or escalating all three tests would ignore the mechanism. Good troubleshooting changes the test to address a specific uncertainty. It doesn’t increase impact simply because the first result was ambiguous.

Your notes should preserve that reasoning. Record the endpoint and test account, the authorized time, the input category, the predicted behavior, the action taken, and the observed result. Separate direct observations from conclusions. If your controlled receiver logged a request, say so.

If an account value changed through the browser condition, state the tested action and account. If reconstruction caused an approved observable effect, connect that effect to the submitted representation. Then state what the evidence supports and what remains unverified.

That distinction affects reporting severity and remediation discussions. A demonstrated boundary failure is different from a theoretical path that wasn’t validated. At the same time, lack of permission to test a higher-impact condition doesn’t make the demonstrated lower-impact behavior harmless. Describe the proven behavior, explain the trust it crosses, and identify any constrained impact as unverified rather than impossible. This gives the application owner evidence that can be reproduced without overstating what the engagement established.

Remediation also has to follow the mechanism. Because the three flaw classes rely on different trust assumptions, evidence that one path was corrected doesn’t validate the others. If the URL-fetch behavior no longer reaches the controlled destination, that result addresses the tested server-request condition. It doesn’t establish that the account form distinguishes intended browser actions, and it says nothing about how the application reconstructs serialized data. Retesting should use the original prediction and evidence for the specific boundary under review.

Suppose you must choose between two next steps in a hypothetical engagement. One option is to make the fetch API contact a third party that isn’t named in scope because the response might be interesting. The other is to use an approved engagement-controlled receiver that can establish whether the application makes the request. The second option fits both the mechanism and the authorization boundary. The first may produce more dramatic output, but it targets an unrelated party and adds risk without first establishing that stronger action is needed.

Now suppose the controlled receiver confirms the application’s request, but a stakeholder asks whether that also proves CSRF. It doesn’t. You can explain that the evidence shows a server-side request influenced by user input.

There’s no demonstrated authenticated browser submitting an unwanted action. Additional information that would change the CSRF assessment would have to concern the browser-mediated account action, not the server’s outbound callback. Keeping those conclusions separate is more valuable than forcing one observation into several vulnerability labels.

The same reasoning applies when the object endpoint returns a severe-looking error. Your two choices might be to label it unsafe deserialization immediately or to determine whether the error is connected to reconstruction and whether controlled behavior can be demonstrated safely. The second choice is stronger. It respects the difference between receipt, parsing failure, and an actual security boundary failure. If operational constraints forbid further testing, document the error and the unresolved hypothesis rather than turning uncertainty into certainty.

Across planning, testing, analysis, and reporting, the pattern remains consistent. Begin with the mechanism you expect, predict evidence that would distinguish it, choose the lowest-impact authorized action, and compare the result with that prediction. When the result conflicts, troubleshoot the target, prerequisites, configuration, timing, and data quality. When the evidence supports only part of the suspected impact, report only that part as demonstrated. That process is what turns three similar-sounding attack names into defensible penetration-testing decisions.

SSRF, CSRF, and unsafe deserialization all begin with attacker-controlled data, but they cross different trust boundaries. The server makes the unintended request in SSRF. The authenticated browser submits the unwanted action in CSRF. A reconstruction component interprets attacker-controlled serialized data in unsafe deserialization.

Those differences determine what evidence can support each finding and why one correction can’t be assumed to fix all three. In an authorized test, predict the expected behavior, use the least-disruptive method that can prove it, and keep observations separate from conclusions. When your evidence is incomplete, preserve the uncertainty instead of escalating beyond scope or overstating impact. That combination of mechanism, authorization, verification, and careful reporting makes the result technically useful and professionally defensible.

Pause and decide: Who acts on the input, and which trust boundary does that action cross? Consult the companion episode reference for exact terminology, named tools or standards, source-derived evidence checkpoints, and review material for SSRF, CSRF, and Insecure Deserialization. This lesson was produced by Bare Metal Cyber dot com.

SSRF, CSRF, and Deserialization

headphones Listen Anywhere

More Options »
Broadcast by