← Lab /Security & privacy

Goja JavaScript engine allows out-of-bounds heap write that enables remote code execution

A bug in Goja’s TypedArray methods permits out-of-bounds heap writes that can be chained into arbitrary read/write and ultimately remote code execution in applications using Goja.

Security & privacy Assetnote / Searchlight 7 Sep 2026 Disclosure Real-world evidence

Published as “Out of Bounds, Out of Sandbox: RCE in Go JavaScript Engine”

Why it matters

Applications embedding Goja and allowing untrusted JavaScript are vulnerable to remote code execution.

Summary

The researchers discovered an out-of-bounds heap write in Goja’s TypedArray with/toReversed methods that, because set() uses unsafe pointer arithmetic, can corrupt heap memory. They built a blind-write primitive, sprayed ArrayBuffers, and located a corrupted buffer to gain arbitrary read/write, then hijacked a Go function pointer (Date.now) to execute arbitrary code. The chain was demonstrated on Zendesk’s SaaS workflow engine and the Nuclei scanner, achieving root-level command execution. The exploit required careful timing and multiple attempts but succeeded in real deployments.

What they found 1

  1. Out-of-bounds heap write in Goja leads to arbitrary code execution

    “During our research we were able to exploit an out-of-bounds heap write vulnerability in Goja, leading to arbitrary code execution on both Zendesk and Nuclei.”

Caveats 3

  • Both because the chance of the write landing correctly is lower and because it is more likely to clobber something important and cause a crash.
  • If the exploit takes too long to run or uses too much memory it is just be stopped.
  • Go is usually compiled without ASLR, the first program segment is almost always mapped in at the same address, 0x400000.

What’s new here 4

  • Identified an out-of-bounds heap write bug in Goja TypedArray methods.
  • Developed a full exploit chain from blind write to arbitrary read/write to function-pointer hijack.
  • Demonstrated remote code execution on two real-world products (Zendesk and Nuclei).
  • Released patches, exploit binaries, and a vulnerable Nuclei template for the community.