Summary
Velociraptor's default-enabled daily notebook backup feature can restore notebook content without applying appropriate access-control checks. A user with NOTEBOOK_EDITOR permission may plant a VQL query that could be evaluated with elevated permissions when the backup is later restored.
Affected context
The vulnerability occurs in Velociraptor deployments that enable notebook backups and subsequently restore those backups. Risk exists when notebook cell content is interpolated into a restoration template without validating its origin or enforcing authorization checks for the restored content. The issue is particularly relevant where notebook editors have fewer privileges than the process performing backup restoration.
Exploit preconditions
- Attack surface: Velociraptor notebook creation and backup restoration workflows
- Required access: Permission to edit notebook content, specifically NOTEBOOK_EDITOR access
- Trigger point: Restoration of a notebook backup containing attacker-controlled cell content
- Why exploitation is possible: Notebook content is inserted into a template and evaluated without sufficient ACL enforcement, allowing lower-privileged content to reach a higher-privileged execution context
Why this happens
The underlying bug is an injection flaw caused by treating notebook cell content as trusted template input during backup restoration. Content supplied by a notebook editor can cross a trust boundary and be evaluated as VQL with the permissions of the restoration process. This behavior maps to CWE-94: Improper Control of Generation of Code ('Code Injection') and is also related to CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine.
Potential impact
- An attacker could cause VQL queries to execute with elevated permissions.
- Sensitive endpoint, user, or forensic data may be exposed.
- The attacker could alter, delete, or poison collected data, depending on available privileges.
- The Velociraptor server or connected environment could be affected through privileged query capabilities.
General mitigation guidance
Mitigation generally focuses on preserving trust boundaries during backup restoration and ensuring that restored content cannot gain privileges merely because it is processed by a privileged service.
Common defensive patterns include:
- Treating notebook cells and backup contents as untrusted data.
- Avoiding direct interpolation of user-controlled content into executable templates.
- Using structured, constrained representations for notebook restoration.
- Applying ACL and authorization checks to every restored cell and query.
- Separating notebook editing privileges from privileged query execution.
- Running restoration workflows with the minimum permissions required.
- Disabling or restricting automatic backups where they are not needed.
How teams detect issues like this
Detection programs can review notebook restoration code for string interpolation, template rendering, or dynamic VQL evaluation involving user-controlled content. Static analysis and code review should identify flows from notebook editors or backup files into query execution APIs without authorization checks.
Runtime monitoring can flag restoration-triggered queries, unexpected privileged VQL activity, and changes to notebook backups by users who do not normally manage recovery data. Policy enforcement can require explicit approval for privileged query execution and can restrict modification of backup storage. Automated security review tools may help identify template-injection and authorization-boundary violations.

