fix: prevent cross-parent IDOR via body-supplied up__ keys - #513
Closed
cschuerings wants to merge 2 commits into
Closed
fix: prevent cross-parent IDOR via body-supplied up__ keys#513cschuerings wants to merge 2 commits into
cschuerings wants to merge 2 commits into
Conversation
cschuerings
requested a deployment
to
pr-approval
August 4, 2026 16:13 — with
GitHub Actions
Waiting
Remove undefined inferTargetCAP8 CAP 8 fallback — cds.infer.target is always available on CDS 9+. Drop unused bobGET variable in test.
cschuerings
requested a deployment
to
pr-approval
August 4, 2026 16:26 — with
GitHub Actions
Waiting
Contributor
Author
|
Not exploitable without the fix. CAP's propagateForeignKeys already overwrites body-supplied up__ keys from the URL path before our handler runs. The removed hasUpKey guard was dead code; the new re-derivation is defense-in-depth only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
finalizePrepareAttachmentused ahasUpKeyguard to skip parent-key population when anyup__key was already present in the request body. An attacker could exploit this by POSTing to a URL they are authorized for (their own parent) while supplying a different parent's ID in the body — the body value would be used as-is, associating the attachment with the victim's parent record.Fix
Remove the
hasUpKeyguard entirely. Parent (up__) keys are now always derived from the URL path, overwriting any values supplied in the request body. A404is returned when the URL-referenced parent record does not exist.Client-supplied attachment IDs on
NEWare also rejected — the server always assigns a UUID.Out of Scope
Authorisation checks beyond existence of the parent record (i.e. whether the requesting user is allowed to write to that parent) remain the responsibility of the application's service handlers.