Summary
SENAITE.CORE contains a critical chain of missing authorization and unsafe evaluation in its JSON API. An unauthenticated attacker may resolve selected objects and cause attacker-controlled values to be evaluated as Python code, potentially enabling remote code execution in the Zope worker.
Affected context
The vulnerability affects SENAITE.CORE deployments using the JSON API state-changing routes, including object update, removal, action, and user-related operations. Risk exists when these routes resolve attacker-selected objects without first enforcing the relevant API permission and when request values for record-related fields reach eval()-based processing before field-level write authorization. The unsafe evaluation pattern is also present in record and records field handling.
Exploit preconditions
- Attack surface: SENAITE.CORE JSON API and related field-processing code
- Required access: No authentication may be required when the affected API routes are exposed
- Trigger point: Processing a state-changing request that supplies a value for a record-related field
- Authorization condition: The route must resolve objects before enforcing the
senaite.core: Access JSON APIpermission - Why exploitation is possible: Raw request data can reach Python evaluation before field mutator write-permission checks, allowing code execution in the application worker
Why this happens
The primary flaw is the evaluation of attacker-influenced request data as Python expressions, which maps to CWE-95: Improper Neutralization of Directives in Dynamically-Evaluated Code. Treating serialized field values as executable expressions creates a code-injection boundary rather than a data-parsing boundary.
The issue is compounded by CWE-862: Missing Authorization, because affected routes can resolve selected objects without consistently checking the required API permission first. Authorization performed later in the request lifecycle cannot reliably protect earlier object resolution or evaluation behavior.
Potential impact
- An attacker may execute arbitrary Python code in the Zope worker
- Laboratory data, files, or account information could be exposed
- Application-managed records and configuration could be modified
- Laboratory operations could be disrupted or rendered unavailable
- Compromised application privileges could enable further access to connected services
General mitigation guidance
Mitigation generally focuses on removing dynamic evaluation from request processing and enforcing authorization before any attacker-influenced object resolution or mutation.
Common defensive patterns include:
- Replacing
eval()with typed parsers, explicit value maps, or schema-constrained deserialization - Treating all request values as data and rejecting expressions or executable constructs
- Enforcing API authorization at the route boundary before resolving objects
- Repeating object-level write checks before each state-changing operation
- Applying least-privilege permissions to the application worker and connected services
- Separating validation, authorization, and mutation into clearly ordered stages
- Restricting anonymous access to administrative and state-changing API surfaces
How teams detect issues like this
Organizations can look for this vulnerability class through:
- Static analysis rules identifying
eval()or equivalent dynamic evaluation on request-derived values - Code searches for request data passed into expression engines, template evaluators, or generic object constructors
- Review of API routes that resolve object identifiers before authentication or permission checks
- Tests verifying that anonymous requests cannot reach state-changing handlers or object-resolution paths
- Policy enforcement requiring authorization checks at route boundaries and before mutation
- Runtime monitoring for unexpected interpreter activity, abnormal worker behavior, or unauthorized API access
Automated security review tools may help identify dynamic evaluation and missing authorization patterns, but findings should be validated against the framework's permission and request-processing flow.

