/

CVE-2026-42615

Severity:

HIGH RISK

(7.2)

XSS in GCHQ CyberChef Show Base64 Offsets

CVE-2026-42615

Awaiting Analysis

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Arbitrary JavaScript Execution in Victim's Browser

Severity:

HIGH RISK

(7.2)

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

GCHQ CyberChef versions before 11.0.0 contain a cross-site scripting (XSS) flaw in the "Show Base64 offsets" recipe, where crafted input is reflected back into the UI without proper sanitization.

An attacker who can convince a victim to open a malicious CyberChef URL can cause arbitrary JavaScript to execute in the victim's browser within the context of the CyberChef application.

Affected context

The vulnerability occurs within CyberChef's web interface when using the "Show Base64 offsets" operation in recipes.

When user-supplied data is embedded into the page output or UI components without robust encoding, it can be interpreted as active script by the browser.

The risk is most pronounced when CyberChef is accessed via URLs that encode recipes and input values, and users routinely open shared or untrusted links.

Exploit preconditions

  • Attack surface: Web UI of CyberChef, typically accessed via browser.
  • Required access: Ability to craft and distribute a malicious CyberChef link or recipe (e.g., via email, chat, documentation).
  • Trigger point: A victim visits a crafted URL that loads a recipe using "Show Base64 offsets" with attacker-controlled data.
  • Why exploitation is possible: The Show Base64 offsets feature reflects untrusted input into the DOM without sufficient context-aware output encoding or sanitization, allowing the browser to interpret the content as executable JavaScript.

Why this happens

This issue stems from improper neutralization of input used in web page generation, aligning with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The underlying pattern is that data from the recipe or URL fragment is treated as display content but is inserted into the HTML/DOM without applying consistent HTML/JavaScript encoding.

As a result, special characters associated with script execution (e.g., <, >, quotes) are not safely encoded, enabling attacker-controlled data to break out of the intended context and execute as script.

Potential impact

  • Execution of arbitrary JavaScript in the victim's browser when viewing a malicious CyberChef link
  • Theft or manipulation of data processed within the CyberChef page (e.g., clipboard interactions, displayed data)
  • Impersonation of the user within the CyberChef context, including modifying recipes or results shown
  • Use of the CyberChef tab as a pivot point for phishing or misleading UI content

General mitigation guidance

Effective mitigation centers on robust output encoding and strict handling of untrusted data within the UI.

Recommended defensive patterns include:

  • Applying context-aware output encoding for any user-controlled data rendered into HTML, attributes, or script contexts.
  • Avoiding direct insertion of raw text into the DOM; use safe DOM APIs with explicit text nodes rather than HTML strings.
  • Normalizing and validating operation output so that special HTML and JavaScript meta-characters are encoded before display.
  • Enforcing Content Security Policy (CSP) that disallows inline scripts and restricts script sources to reduce XSS exploitability.
  • Treating URL fragments and recipe parameters as untrusted input at all times, and sanitizing them before use in UI rendering.

How teams detect issues like this

Detection typically involves both code-centric and behavior-centric approaches:

  • Static analysis: Look for DOM sinks that consume data derived from URL fragments, recipes, or user inputs without encoding (e.g., innerHTML, document.write, dynamic HTML templates).
  • Code review: Flag any rendering logic associated with the "Show Base64 offsets" operation where text is interpolated into HTML; verify that appropriate escaping functions are consistently applied.
  • Security testing: Use automated or manual web scanners configured with XSS payloads in recipe and input fields, including URL-encoded fragments feeding the Show Base64 offsets operation.
  • Policy enforcement: Incorporate linting rules or framework-level security guidelines that discourage insecure DOM manipulation and enforce safe templating patterns.

Sources

SourceLink
github.comgithub.com/gchq/CyberChef/commit/9641ae07f92e9af50f10e978385465b2f4a36c4d
github.comgithub.com/gchq/CyberChef/compare/v10.24.0...v11.0.0
github.comgithub.com/gchq/CyberChef/issues/2344
github.comgithub.com/gchq/CyberChef/pull/2346

Frequently asked

questions

Yes. An attacker can host or share a specially crafted CyberChef URL; when a victim opens it in a browser, the malicious script can execute without any further interaction.

Typically no. The attack relies on the victim visiting an attacker-controlled or attacker-modified URL. No special permissions are required beyond the victim's normal access to CyberChef.

Ensure that all data influencing the "Show Base64 offsets" UI is treated as untrusted and is passed through correct context-aware output encoding before being injected into the DOM, and avoid using HTML-string-based rendering where possible.

Adopt a secure-by-default templating or UI framework that auto-escapes output, enforce CSP to limit script execution vectors, avoid direct use of dangerous DOM APIs, and include XSS-focused checks in both code review and automated testing for any new UI features.

Find out what's already
exploitable in your codebase.