/

CVE-2026-33622

Severity:

HIGH RISK

(8.8)

Code Injection / Policy Bypass in PinchTab Wait Endpoints

CVE-2026-33622

Analyzed

Vulnerability type

Category:

Code Injection / Policy Bypass

CWE:

CWE-94, CWE-284, CWE-693

Impact:

Arbitrary Code Execution in Browser Context (within authenticated session)

Severity:

HIGH RISK

(8.8)

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

PinchTab versions 0.8.3 through 0.8.5 contain a security-policy bypass that allows arbitrary JavaScript execution via the POST /wait and POST /tabs/{id}/wait endpoints when using fn mode.

Even when security.allowEvaluate is disabled, an authenticated caller holding the server token can supply a JavaScript function body that is embedded into executable code and run in the browser tab context.

Affected context

This issue affects PinchTab deployments that:

  • Run versions v0.8.3 through v0.8.5
  • Expose the HTTP API to AI agents, automation systems, or other services that hold the server token
  • Rely on the security.allowEvaluate setting (disabled by default) to prevent direct JavaScript execution

In this context, the /wait and /tabs/{id}/wait endpoints accept a mode parameter, and when fn mode is used, user-controlled JavaScript is evaluated in the Chrome tab.

Exploit preconditions

  • Attack surface: PinchTab HTTP API, specifically:
  • POST /wait in fn mode
  • POST /tabs/{id}/wait in fn mode
  • Required access: Valid server token or equivalent authenticated API access; there is no unauthenticated vector described.
  • Trigger point: Sending a POST request using fn mode with an attacker-controlled fn expression while security.allowEvaluate is disabled or expected to block evaluation.
  • Why exploitation is possible: The implementation embeds the user-supplied fn expression directly into a JavaScript snippet and evaluates it in the browser context, but fails to enforce the security.allowEvaluate policy on the /wait endpoints, even though that policy is correctly enforced on /evaluate. This creates a policy enforcement gap (CWE-693) and insufficient access control over code execution (CWE-284).

Why this happens

The underlying bug is a form of code injection (CWE-94) combined with inconsistent security policy enforcement (CWE-693):

  • The /wait and /tabs/{id}/wait endpoints support a fn mode where a client supplies a JavaScript function body.
  • This function body is treated as trusted and concatenated into an executable JavaScript context without appropriate validation or restriction.
  • While the /evaluate endpoint checks the security.allowEvaluate flag before executing arbitrary JavaScript, the fn mode of /wait does not apply the same guard.

Conceptually, this reflects an insecure pattern where different code paths that perform the same high-risk operation (remote code execution in a browser tab) are not consistently protected by the same policy boundary and authorization checks. The application assumes all code evaluation flows are guarded, but an alternate path is left unprotected.

Potential impact

  • Execution of arbitrary JavaScript in the target Chrome tab for any caller with the PinchTab server token
  • Manipulation of active web sessions, including DOM modification, form submission, or simulated user actions
  • Access to sensitive data available to the tab, such as page content, DOM-stored secrets, or local application state
  • Potential abuse of the browser as an automation or attack pivot (e.g., triggering actions in authenticated web apps open in the tab)
  • Violation of operator expectations and policies that rely on security.allowEvaluate being a strong boundary

General mitigation guidance

Until a patched release is available, operators and developers can focus on reducing exposure of code-evaluation capabilities and tightening access boundaries:

  • Consolidate policy enforcement for code execution paths: Ensure that all endpoints and modes that can execute user-controlled code use a single, centralized authorization and policy check (e.g., always consult security.allowEvaluate or an equivalent capability flag).
  • Restrict API credentials and trust boundaries: Treat the PinchTab server token as a high-privilege secret. Limit which agents or services receive it, and segregate tokens by trust level (e.g., separate tokens for read-only navigation vs. code execution workflows).
  • Disable or restrict fn-style dynamic code modes where not needed: Prefer non-code-based waiting or synchronization mechanisms (e.g., time-based waits, DOM selectors, or ready-state checks) instead of arbitrary function execution.
  • Apply least-privilege configuration: Run PinchTab in environments that minimize the risk from browser compromise (e.g., dedicated profiles, restricted network access from the browser, constrained data access).
  • Introduce higher-level policy controls: Wrap PinchTab behind an API gateway or mediator that filters or disallows high-risk operations (such as arbitrary fn payloads) for less-trusted agents.

How teams detect issues like this

Detection can focus on both code-level issues and runtime behavior:

  • Static analysis and code review:
  • Identify all code paths that assemble or evaluate JavaScript from user-controlled input (e.g., string concatenation into scripts, eval-like constructs, or remote debugging protocol calls).
  • Verify that each such path consistently consults the same security policy or configuration flag before execution.
  • Look for duplicated logic around code evaluation where one path references security.allowEvaluate and others do not.
  • Configuration and policy audits:
  • Review service configurations to identify deployments that rely on security.allowEvaluate for risk reduction.
  • Confirm that downstream consumers (AI agents, automation frameworks) are not sending fn-mode requests in contexts where evaluation is meant to be disabled.
  • Runtime monitoring and logging:
  • Enable detailed logging for calls to /wait, /tabs/{id}/wait, and /evaluate, including the mode used and whether the policy was applied.
  • Create alerts for unexpectedly frequent or complex fn-mode invocations, especially when security.allowEvaluate is configured as disabled.
  • Automated security review tools:
  • Use application security testing tools or custom linters that flag any usage of dynamic code execution APIs that are not protected by the standard policy enforcement routine.

Sources

SourceLink
github.comgithub.com/pinchtab/pinchtab/security/advisories/GHSA-w5pc-m664-r62v

Frequently asked

questions

Yes, but only through the authenticated PinchTab HTTP API. An attacker must be able to send HTTP requests to the service and possess a valid server token or equivalent credentials.

No. It does not provide a new way to log in or obtain credentials. Instead, it allows a caller that is already authenticated and authorized to use the API to execute arbitrary JavaScript despite a configured policy (security.allowEvaluate) that is meant to block such execution.

Apply a single, centralized policy check for all code execution paths, ensuring that any feature capable of evaluating user-supplied JavaScript (including fn modes and helper wrappers) enforces the same guard as /evaluate. Treat any addition of new code-evaluating endpoints as a high-risk change that must integrate with this shared enforcement mechanism.

Design APIs so that high-risk capabilities like code execution are clearly separated, consistently guarded, and easy to audit. Avoid multiple, ad-hoc pathways for executing code; instead, route all such behavior through a small, well-reviewed component that enforces policies and access controls. Combine this with strong credential hygiene, least-privilege tokens, and automated checks that flag any new dynamic execution flows that bypass the central policy.

Find out what's already
exploitable in your codebase.