Summary
SurrealDB's streaming engine does not consistently apply --deny-funcs restrictions to functions invoked using method-style syntax. An authenticated user who can submit queries may be able to call denied functions this way, including functions that read or write file bucket data.
SurrealDB's streaming engine does not consistently apply --deny-funcs restrictions to functions invoked using method-style syntax. An authenticated user who can submit queries may be able to call denied functions this way, including functions that read or write file bucket data.
Affected context
The issue occurs in SurrealDB's streaming engine when it evaluates method-style function calls. The affected behavior is described for SurrealDB 2.0.0 before 3.3.1, where resolved functions invoked through this syntax may not undergo the expected capability check.
The issue occurs in SurrealDB's streaming engine when it evaluates method-style function calls. The affected behavior is described for SurrealDB 2.0.0 before 3.3.1, where resolved functions invoked through this syntax may not undergo the expected capability check.
Exploit preconditions
- Attack surface: Query execution in the streaming engine
- Required access: An authenticated account able to submit queries
- Trigger point: Evaluation of a method-style function call
- Why exploitation is possible: The method evaluation path may invoke a resolved function without checking whether it is denied by the configured function restrictions
- Attack surface: Query execution in the streaming engine
- Required access: An authenticated account able to submit queries
- Trigger point: Evaluation of a method-style function call
- Why exploitation is possible: The method evaluation path may invoke a resolved function without checking whether it is denied by the configured function restrictions
Why this happens
The streaming engine's method-call evaluation path does not consistently enforce function capabilities. This is an authorization enforcement failure that maps to CWE-284: Improper Access Control: a restriction applied to function calls is bypassed when the same function is reached through a different invocation path.
The streaming engine's method-call evaluation path does not consistently enforce function capabilities. This is an authorization enforcement failure that maps to CWE-284: Improper Access Control: a restriction applied to function calls is bypassed when the same function is reached through a different invocation path.
Potential impact
- Authenticated users may call functions that administrators intended to deny
- Users may be able to read file bucket data through restricted functions
- Users may be able to write or modify file bucket data
- Applications relying on function denials for access control could expose sensitive data or operations
- Authenticated users may call functions that administrators intended to deny
- Users may be able to read file bucket data through restricted functions
- Users may be able to write or modify file bucket data
- Applications relying on function denials for access control could expose sensitive data or operations
General mitigation guidance
Defensive patterns focus on enforcing authorization consistently across every function invocation path.
- Apply capability checks after function resolution and before execution, regardless of call syntax.
- Use secure-by-default function policies and explicitly allow only the functions required by each workload.
- Reduce trust in user-submitted queries by limiting who can submit them and constraining permitted query operations.
- Keep query execution identities and file bucket permissions limited to the minimum required.
- Treat function restrictions as one layer of defense, not a substitute for underlying data access controls.
Defensive patterns focus on enforcing authorization consistently across every function invocation path.
- Apply capability checks after function resolution and before execution, regardless of call syntax.
- Use secure-by-default function policies and explicitly allow only the functions required by each workload.
- Reduce trust in user-submitted queries by limiting who can submit them and constraining permitted query operations.
- Keep query execution identities and file bucket permissions limited to the minimum required.
- Treat function restrictions as one layer of defense, not a substitute for underlying data access controls.
How teams detect issues like this
- Review function evaluation paths to confirm that capability checks apply equally to direct and method-style calls.
- Use static analysis or code review checks to identify function invocation paths that bypass centralized authorization.
- Test policy enforcement with representative call forms, including method-style calls, and verify that denied operations remain blocked.
- Monitor query activity for restricted function usage and unexpected file bucket reads or writes.
- Enforce query and function policies through centralized authorization controls and automated security checks.
- Review function evaluation paths to confirm that capability checks apply equally to direct and method-style calls.
- Use static analysis or code review checks to identify function invocation paths that bypass centralized authorization.
- Test policy enforcement with representative call forms, including method-style calls, and verify that denied operations remain blocked.
- Monitor query activity for restricted function usage and unexpected file bucket reads or writes.
- Enforce query and function policies through centralized authorization controls and automated security checks.

