[security] Mass assignment fix sweep
fix: [security] Mass assignment fix sweep
[security] Mass assignment fix sweepbc182d-fix-security-mass-assignment-fix-sweep-cve-2026-56422fixsecurity mass assignment fix sweep
Committed by iglocska
commit message
fix: [security] Mass assignment fix sweep
EventsController (via Event model capture paths): freetext import and module-
result import saved client-supplied nested Attribute/Object data directly with
no id strip and no fieldList, so an injected primary key inside the JsonObject
payload redirected save() onto an arbitrary existing attribute/object - and
moved it into the attacker's event via the forced event_id. CSRF does NOT
mitigate this: the id rides inside a legitimately user-controlled JSON field
value, and saveFreeText is reachable over the REST API.
- Strip the primary key before every create-only capture save:
processFreeTextData (attribute), processModuleResultsData (attribute + both
object branches), and __saveObjectAttribute. These paths only ever create new
rows; existing rows are matched server-side by uuid/value, never by client id.
- Event-level add/edit were already safe (_add unsets id 4966, _edit re-pins it
to the DB-looked-up event 5305); non-REST edit's top-level Event[id] is
CSRF-field-hash gated (left as-is, mirrors the admin_add decision).
- milestone EventsController of the mass-assignment audit.
- Verified live: saveFreeText with a victim attribute id inside JsonObject now
creates a new attribute and leaves the victim untouched; with the strip removed
the same request overwrote the victim and stole it into the attacker's event.
- as reported by Jeroen Pinoy
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>Editor assessment
This commit patches CVE-2026-56422. The body explains the freetext and module-result import paths in the Event model, where nested Attribute and Object payloads were saved with no id strip, so an injected primary key redirected save and the forced event_id moved the row into the attacker's event. It correctly notes that CSRF does not mitigate this because the id rides inside a JSON field and saveFreeText is REST-Reachable. The fix, stripping the primary key at each create-only capture sink, is enumerated with function names and paired with a live demonstration. Concise enough to follow, though the sweep subject is vague.