/

CVE-2026-47252

Severity:

CRITICAL RISK

(9.0)

Code Injection (CWE-94) in Anyquery macOS SQL Plugins

CVE-2026-47252

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary OS Command Execution

Severity:

CRITICAL RISK

(9.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A code injection vulnerability in Anyquery's macOS browser plugins allows authenticated users with INSERT or UPDATE access to affected virtual tables to inject statements into AppleScript or JXA code. Crafted URL values may cause the Anyquery process to execute arbitrary operating-system commands with its privileges on the macOS host.

Affected context

The vulnerability occurs in Anyquery macOS virtual-table plugins for Chrome and equivalent integrations for Brave, Edge, and Safari. It becomes risky when authenticated users can write URL values through INSERT or UPDATE operations and the plugin constructs AppleScript or JXA source by interpolating those values without safe source-level escaping.

Exploit preconditions

  • Attack surface: Anyquery macOS browser virtual tables that create or update tab URLs
  • Required access: Authenticated database access with INSERT or UPDATE permission on an affected table
  • Trigger point: Processing a write operation that embeds a SQL-controlled URL into AppleScript or JXA
  • Why exploitation is possible: URL input is incorporated into executable script text, allowing string and statement boundaries to be altered

Why this happens

The underlying flaw is direct interpolation of SQL-controlled data into AppleScript or JXA source generated with formatted strings. Quote and newline characters can change the structure of the generated script instead of remaining data, causing the interpreter to process attacker-controlled statements. This maps to CWE-94: Improper Control of Generation of Code, because untrusted input is included in dynamically generated executable code without context-appropriate encoding or safe parameter handling.

Potential impact

  • Arbitrary operating-system commands may execute on the macOS host
  • The Anyquery process account could be compromised
  • Local files or credentials accessible to that account could be exposed
  • Browser sessions, data, or system configuration could be modified
  • The host could be used for persistence, lateral movement, or further compromise

General mitigation guidance

Mitigation generally focuses on preventing data from becoming executable script source and reducing the privileges available to the query engine.

Common defensive patterns include:

  • Avoiding string interpolation when generating AppleScript or JXA
  • Using structured APIs, argument passing, or context-aware escaping mechanisms
  • Validating URL values against an explicit scheme and format policy
  • Separating data from code at the automation boundary
  • Restricting INSERT and UPDATE permissions on browser virtual tables
  • Running Anyquery with a dedicated least-privilege account and limited filesystem access
  • Applying macOS execution and sandboxing controls where practical
  • Treating database-writable values as untrusted even when supplied by authenticated users

How teams detect issues like this

Detection can combine source review, runtime monitoring, and access-policy checks.

  • Use static analysis rules to identify formatted strings passed to AppleScript, JXA, shell, or other interpreters.
  • Review code paths where SQL, HTTP, or user-controlled values are concatenated into executable scripts.
  • Flag browser-plugin write handlers that pass unvalidated fields into automation APIs.
  • Monitor Anyquery child-process creation, especially unexpected osascript executions and unusual command-line arguments.
  • Audit permissions to confirm that only trusted identities can write to affected virtual tables.
  • Enforce code-review and CI policies that prohibit dynamic script construction without approved safe-parameter patterns.

Sources

SourceLink
github.comgithub.com/julien040/anyquery/commit/33769e03bd4b0f76d7a20a4188cce7153f6db1c9
github.comgithub.com/julien040/anyquery/releases/tag/0.4.5
github.comgithub.com/julien040/anyquery/security/advisories/GHSA-hrj8-hjv8-mgwc

Frequently asked

questions

An attacker generally needs authenticated Anyquery access with INSERT or UPDATE permission on an affected macOS virtual table. Authentication alone is not necessarily sufficient if write permissions are restricted.

Yes. The affected browser integrations invoke AppleScript or JXA through macOS automation tooling, so the relevant plugin and operating-system execution path must be available.

Keep URL and other user-controlled values as data rather than interpolating them into executable script source. Prefer structured automation interfaces, safe argument passing, and strict input validation.

Review all dynamic script-generation paths, limit database write privileges, monitor unexpected interpreter launches, and run query engines with the minimum host permissions required.

Find out what's already
exploitable in your codebase.