A client-supplied identity must not address an existing object - #1690
Open
rubenvdlinde wants to merge 1 commit into
Open
A client-supplied identity must not address an existing object#1690rubenvdlinde wants to merge 1 commit into
rubenvdlinde wants to merge 1 commit into
Conversation
…object PRE-EXISTING, and found by sweeping the class of the store defect in #1687 rather than by a report. Proven on a running instance, before and after. `ObjectService::saveObject()` does not take its target as an argument the caller controls. `extractUuidAndNormalizeObject()` reads `$object['@self']['id'] ?? $object['id']` and treats a match as the uuid to UPDATE, and the write is PUT-semantic, so keys the payload omits are NULLED. Seven controllers build their payload from `$this->request->getParams()`. Several already stripped `id` for exactly this reason — the intent was right — but none stripped `@self`, which is the key saveObject reads FIRST. MEASURED, not reasoned. Against the mandate-roles CREATE endpoint: POST /api/mandate/rollen {"roleName": "...", "@self": {"id": <victim>}} -> 201, and the created id IS the victim's uuid -> the victim's row now holds the attacker's values Any authenticated user could replace an arbitrary object of that schema through an endpoint whose whole job is to create one. The fix is mostly central. `ConfiguredRegistryService::save()` already takes `$id` for the update case, so the payload's identity is stripped there and the parameter becomes the ONLY way to address an existing object — which is what it was always for. The controllers that do not route through that service get the same strip at their own client boundary. `NrcController` was checked and left alone: it echoes the body back in a response and writes nothing. Evidence, in the order it was taken: the live exploit above; a unit test with a negative control (removing the strip fails both new tests); a second test that the explicit `$id` still updates, so the guard cannot have traded a security hole for silent duplication; and the same live exploit re-run against the fixed code, where the attacker now gets a NEW object and the victim is untouched. 2769 tests, phpcs clean.
rubenvdlinde
requested review from
WilcoLouwerse,
bbrands02 and
rjzondervan
as code owners
September 2, 2026 19:15
Contributor
Quality Report — ConductionNL/dossiq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| check-vue3-compile | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| check-l10n-js | ✅ | ||||
| composer | ✅ | ✅ 106/106 | |||
| npm | ✅ | ✅ 540/540 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ✅ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ deferred — runs on the promotion into beta/main, not on a pull request into development | ||||
| Hydra gates | ✅ |
Quality workflow — 2026-09-02 19:29 UTC
Download the full PDF report from the workflow artifacts.
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.
Pre-existing. Found by sweeping the defect class from #1687, not from a report. Proven on a running instance before and after the fix.
The defect
ObjectService::saveObject()does not take its target as an argument the caller controls:A match is treated as the uuid to UPDATE, and the write is PUT-semantic, so keys the payload omits are nulled.
Seven controllers build their payload from
$this->request->getParams(). Several already strippedidfor exactly this reason — the intent was right — but none stripped@self, which is the keysaveObjectreads first.Measured, not reasoned
Against the mandate-roles create endpoint:
Any authenticated user could replace an arbitrary object of that schema, through an endpoint whose entire job is to create one.
The fix
Mostly central.
ConfiguredRegistryService::save()already takes$idfor the update case, so the payload's identity is stripped there and that parameter becomes the only way to address an existing object — which is what it was always for. Controllers that do not route through that service get the same strip at their own client boundary.NrcControllerwas checked and deliberately left alone: it echoes the body back in a response and writes nothing.Evidence, in the order taken
$idstill updates, so the guard cannot have traded a security hole for silent duplication.{ "attackerGotDifferentId": true, "victimNameNow": "VICTIM2-original", "VERDICT": "SAFE — victim untouched, attacker got a new object" }2769 tests, phpcs clean.
🤖 Generated with Claude Code