Summary
Knowns contains an authorization bypass in which mutating code actions are incorrectly treated as read-only operations. An attacker with a read-restricted session may use the code.replace action to alter permission configurations and potentially gain greater privileges on later requests.
Affected context
The vulnerability occurs in Knowns deployments where code actions are exposed to sessions with read-restricted permissions and authorization decisions rely on an incorrect classification of the requested operation. The risk is greatest when code.replace can modify permission-related configuration and those changes affect authorization decisions for subsequent calls.
Exploit preconditions
- Attack surface: Exposed code action or API handling for
code.replace - Required access: A valid session limited to read-oriented permissions
- Trigger point: Submission of a mutating code action followed by later authorization-sensitive requests
- Why exploitation is possible: The authorization layer treats a state-changing action as read-only and fails to enforce the permissions required for configuration changes
Why this happens
The underlying bug is an authorization enforcement failure mapped to CWE-863: Incorrect Authorization. A mutating operation is classified as read-only, allowing it to pass a weaker authorization check than its actual behavior warrants. Because the action can change permission configuration, the incorrect classification creates a path from limited access to subsequent privilege escalation.
Potential impact
- A read-restricted user may modify permission configurations
- Subsequent requests could receive privileges beyond the original session scope
- Unauthorized users may gain access to protected actions or resources
- Tenant, project, or administrative boundaries could be weakened
- Audit records may show an apparently permitted read operation instead of the underlying mutation
General mitigation guidance
Mitigation generally focuses on authorizing operations according to their effective behavior rather than their nominal API label. Mutating actions should use explicit write authorization, and permission configuration should be protected by a separate privileged capability where practical. Secure defaults include deny-by-default handling for unclassified actions, centralized policy evaluation, immutable or tightly controlled authorization state, and revalidation of permissions after configuration changes. Untrusted clients should not determine whether an action is read-only, and service identities should operate with only the privileges required for their tasks.
How teams detect issues like this
Detection can include static and policy analysis that compares action names and implementations for state-changing behavior, especially where a read-only annotation controls authorization. Code review should flag endpoints that mutate configuration, permissions, or policy while using read scopes or read-only middleware. Dynamic tests can verify that restricted sessions cannot invoke every mutating action and that permission changes do not bypass reauthorization. Automated review tools and CI policy checks can help identify inconsistent operation classification.

