IDOR, Session Hijacking, File Inclusion, and Web Shells

An authorized test account requests an invoice from a web application. The request contains an invoice number, and the server returns the expected document. If you replace that number with another valid number and receive a different invoice, what have you proved? This episode e…

An authorized test account requests an invoice from a web application. The request contains an invoice number, and the server returns the expected document. If you replace that number with another valid number and receive a different invoice, what have you proved?

You’ve shown that the identifier affects which object the server returns. You haven’t yet proved that the second invoice belongs to someone your account isn’t authorized to access. That difference between an interesting observation and a validated finding will guide every decision in this episode.

The PenTest+ PT0-003 objectives place insecure direct object reference, session hijacking, arbitrary code execution, remote and local file inclusion, and web shells within scenario-based web application attacks. Those names can appear close together in an attack chain, but they don’t describe the same security failure. One concerns authorization to an object.

Another concerns control of an authenticated session. The remaining concepts concern files, code execution, or a mechanism left in a web-accessible location. If you label them interchangeably, your technical explanation and your recommended remediation can both miss the real problem.

Start with insecure direct object reference, or IDOR. An application often needs some way to identify the object a user wants, such as an invoice, support ticket, project record, or uploaded document. The identifier might be supplied in a request. That alone isn’t a vulnerability. The important question is whether the application checks that the authenticated user is authorized to perform the requested action on that particular object.

This is why IDOR is best understood as an object-level authorization problem. Authentication answers who the application believes you are. Authorization answers what that identity may do. A person can be properly signed in and still receive an object that belongs to another account if the server trusts a supplied identifier without enforcing the necessary object authorization. OWASP’s API security material ranks broken object-level authorization as its first API risk and emphasizes authorization checks for the requested objects.

Now return to the invoice response. Before testing, establish a predicted result. Account A owns invoice A, while Account B owns invoice B. When authenticated as Account A, requesting invoice A should succeed.

Requesting invoice B should be denied or otherwise handled without exposing B’s protected information. In an authorized lab, using records created specifically for those two test accounts gives you a known ownership relationship. If Account A receives B’s protected invoice, the result supports a broken object authorization finding because the expected and observed authorization states conflict.

Suppose instead that both invoices belong to Account A. Changing the identifier and receiving the second invoice demonstrates ordinary object selection, not missing authorization. Or perhaps the invoice is intentionally shared with both accounts. The response is different, but access might still be correct.

Even a sequential identifier doesn’t prove a flaw by itself. You need evidence about the identity in use, the object’s ownership or access policy, the action attempted, and the response. The security finding is the unauthorized access, not merely the editable number.

Session hijacking crosses a different boundary. Here, the central problem isn’t whether a legitimate account may access a particular object. It’s whether someone who shouldn’t control that user’s authenticated session can act through it. The application may perform object authorization correctly for the session identity and still produce harmful results because the wrong person has gained control of that session. In other words, the server could be consistently authorizing requests for Account B while an unauthorized person is operating as Account B through hijacked session state.

That distinction changes your evidence. For an object authorization test, you compare what one authenticated identity may do with different objects. For a session test, you’re investigating whether session state can be improperly obtained, accepted, or controlled by someone else. Seeing another account’s invoice doesn’t automatically tell you which failure occurred.

If your test account remains Account A and the server returns B’s invoice, broken object authorization is the likely interpretation. If the application treats your requests as B because B’s session has been taken over, the issue concerns the session boundary. Both can expose the same invoice, but the mechanisms and corrective actions differ.

Arbitrary code execution is different again. It describes an outcome in which attacker-chosen code can execute in the affected environment. Accessing another user’s record isn’t code execution.

Controlling a session isn’t automatically code execution either. A hijacked privileged session could provide access to dangerous application functions, but you’d still need separate evidence that a function actually crosses into execution of attacker-chosen code. Don’t promote an access result into an execution claim simply because a more serious chain seems possible.

File inclusion concerns an application selecting or loading a file in an unsafe way. Local file inclusion, or LFI, concerns a local file. Remote file inclusion, or RFI, concerns a file from a remote location. The essential distinction is where the included file comes from.

Neither label should be used merely because a response displays a file. The application’s inclusion behavior and the file’s origin are what separate these conditions. A confirmed inclusion weakness also doesn’t justify assuming arbitrary code execution unless the evidence actually establishes execution.

A web shell is another distinct concept. It’s a persistence or execution mechanism placed in a web-accessible context. Through that mechanism, someone may be able to cause actions or code to run through web requests. The web shell is therefore an outcome or tool in the chain, not the root cause that made placement or execution possible. An unsafe upload function, a file inclusion weakness, an authorization failure, or some other condition might contribute to the path, but finding one of those conditions doesn’t prove that a web shell exists.

Consider an authorized lab application with two separate features. The invoice endpoint accepts an object identifier. An upload feature accepts server-side content and can place it somewhere on the server. You first confirm that Account A can retrieve an invoice known to belong only to Account B.

That supports an object authorization failure. The upload feature is still a separate test subject. You can’t report code execution merely because content was accepted, and you can’t call the uploaded content a web shell merely because it was placed on the server.

Predict the states before escalating. If the upload function is intended to store a harmless test file, acceptance of that file shows that upload occurred. Evidence that the file is placed in a web-accessible context would support a further placement conclusion. Evidence that server-side content actually executes would support an execution conclusion.

A persistent web-accessible execution mechanism would support the web-shell description. Each conclusion requires its own evidence. The earlier authorization flaw may enable access to the upload function, but it doesn’t erase the need to validate each later step.

This creates a plausible chain from a seemingly limited access-control weakness to a higher-impact outcome. Account A accesses an administrative object or function that should be available only to Account B. That unauthorized access exposes an upload capability. The capability places content in a server context.

If the server then executes the content and makes the mechanism reachable through the web application, the impact has moved beyond unauthorized object access. Yet the chain is only as strong as its validated links. If placement occurs without execution, the execution claim fails. If the upload feature was already authorized for Account A, the initial IDOR might not be the route to it.

Engagement boundaries matter before any attempt to prove those later links. Check the authorized targets, accounts, techniques, timing, and operational constraints. Confirm whether file placement or execution testing is permitted and whether dependencies could be affected.

A technically possible escalation isn’t automatically an authorized one. If the rules allow only access-control validation, proving that Account A can reach Account B’s protected upload function may be the correct stopping point. The report can explain the potential chain without pretending that untested execution occurred.

Where stronger validation is permitted, use the lowest-impact method that can establish the required evidence. The purpose isn’t to demonstrate every possible action available through code execution. It’s to determine whether the security boundary can be crossed.

A benign, reversible proof within the controlled environment may be enough. If that lower-impact result establishes execution, additional actions add operational risk without necessarily adding useful certainty. Cleanup requirements also need to be understood before placing anything on the system, especially a persistent mechanism.

Imagine that the upload request succeeds, but the expected test content can’t be retrieved afterward. Several explanations remain. The application may have renamed the file, placed it outside a web-accessible location, rejected part of its content, or reported success before another control handled it.

Your request may also have targeted the wrong account or environment. The result is incomplete evidence, not proof of a web shell and not proof that the feature is safe. Recheck the target, test identity, prerequisites, expected behavior, and freshness of the observed data before trying a stronger technique.

Conflicting invoice results need the same discipline. Suppose Account A requests B’s invoice number and receives a document, but the customer name is missing and the document appears identical to a public template. You don’t yet know whether protected data crossed the authorization boundary. Compare a controlled invoice from B with the returned content, and confirm the ownership and sharing rules.

The application may be exposing a common template, stale cached data, or an intentionally shared resource. Alternatively, it may be leaking B’s protected invoice. The identifier change alone can’t distinguish those possibilities.

Now suppose the response includes B’s known test-only invoice details, while the application still identifies the requester as Account A. That combination is much stronger. The authenticated identity is known, the object relationship is known, the expected denial is known, and the observed response contains protected data from the unauthorized object. You can describe the finding without claiming session hijacking, file inclusion, or code execution. Keeping the statement narrow makes it more defensible, not less serious.

Good evidence also preserves the difference between observation and interpretation. An observation might say that a request made through Account A returned the controlled invoice assigned only to Account B. The interpretation is that the endpoint failed to enforce object-level authorization for that action.

If you later establish that the same failure exposes a restricted upload function, document that as another validated consequence. If permitted execution testing then succeeds, record the execution evidence as a separate link. This lets a reviewer see exactly where certainty ends and where potential impact begins.

The chain affects remediation. For the invoice endpoint, the application needs effective authorization checks for the requested object and action rather than trust in a client-supplied identifier. For a session problem, the team must address the way session state is protected and accepted.

For file inclusion, attention belongs on unsafe file selection or inclusion behavior. For arbitrary execution and a web shell, responders need to understand the execution path, remove any placed mechanism, and address the weakness that permitted it. One generic recommendation can’t accurately cover every root cause in the chain.

Reporting should also state the account roles, controlled objects, request context, expected result, observed result, and engagement limits. If execution wasn’t attempted because it was outside scope, say so. If a plausible upload-to-execution path remains unverified, describe it as potential impact that requires further authorized validation. Don’t write that a web shell was obtained when the evidence only shows unauthorized access to an upload page. Clear qualification helps the application owner prioritize investigation without turning a hypothesis into a fact.

Consider a final decision. You’ve proved that a low-privilege test account can access another controlled account’s restricted upload function. The engagement allows authorization testing but excludes placing executable server-side content. One option is to upload such content anyway because it might prove greater impact.

The other is to preserve the authorization evidence, check whether a harmless permitted upload can clarify the feature’s behavior, and request approval before any execution test. The second option fits the evidence and the boundaries. The first may be technically revealing, but it silently expands the test.

If explicit approval later includes controlled execution validation, your next decision still depends on mechanism. Ask what result would prove the claim with the least disruption. A successful file upload alone proves upload, not inclusion or execution.

A local file being selected doesn’t establish remote file inclusion. One execution result doesn’t prove a persistent web shell unless a web-accessible execution mechanism has actually been placed and remains available. Precise claims prevent a dramatic label from outrunning the evidence.

The same reasoning helps when two choices both appear technically plausible. Prefer the choice that matches the suspected mechanism, stays within authorization, and produces evidence that can confirm or reject a clear prediction. Avoid the choice that assumes an unproved link or creates unnecessary impact. Additional information could change the decision, such as explicit permission for execution testing, confirmation that an object is private, or evidence that content was placed in a web-accessible context. Until then, uncertainty belongs in the record rather than being filled with assumptions.

By following the path from requirement to prediction, bounded action, verification, and documentation, you preserve the meaning of each result. An object authorization failure may be the first opening in a larger chain, but every later outcome must be independently supported. That gives the people receiving the report both an accurate root cause and a credible account of how far the demonstrated impact actually reached.

IDOR, session hijacking, file inclusion, arbitrary code execution, and web shells can appear in one attack path, but they identify different broken boundaries or outcomes. A changed identifier supports an authorization finding only when the user, object relationship, expected policy, and unauthorized response are established. An upload or inclusion result doesn’t become code execution without execution evidence, and a web shell is the web-accessible persistence or execution mechanism, not the original flaw. In an authorized engagement, the sound decision is to validate each link with the least disruptive permitted action, document what remains uncertain, and stop before a technically possible step exceeds scope. That precision makes both the risk explanation and the remediation more defensible.

One final question should stay with you: If you replace that number with another valid number and receive a different invoice, what have you proved? The companion episode reference provides exact terminology, named tools or standards, source-derived evidence checkpoints, and review material for IDOR, Session Hijacking, File Inclusion, Code Execution, and Web Shells. This lesson was produced by Bare Metal Cyber dot com.

IDOR, Session Hijacking, File Inclusion, and Web Shells

headphones Listen Anywhere

More Options »
Broadcast by