Skip to content
RCE Disclosed report Intermediate

Arbitrary Code Execution in json-ptr

The json-ptr library before version 2.1.0 allows arbitrary code execution when untrusted user input is passed to its .get() method. An attacker could exploit this to run code on the server.

418sec/json-ptr

Originally disclosed on huntr

There is a security vulnerability in json-ptr versions prior to v2.1.0 in which an unscrupulous actor may execute arbitrary code. If your code sends un-sanitized user input to json-ptr's .get() method, your project is vulnerable to this injection-style vulnerability.

From the GitHub Advisory Database (GHSA-rrqv-vjrw-hrcr, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the library fails to properly sanitise or validate the pointer string before using it in a way that allows code execution, such as passing it to a function that evaluates code.

Impact

An attacker could execute arbitrary code on the server, potentially leading to full system compromise.

What the attacker needed

Application uses json-ptr before v2.1.0; user input passed to .get() without sanitisation

The fix

The vulnerability was fixed in version 2.1.0; users should upgrade to that version or later.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

json-ptr is a small library that helps find values inside JSON data using a path like '/a/b'. If a program passes user-supplied input directly to its .get() method without cleaning it, an attacker can craft a special path that makes the library run their own code. This is dangerous because the attacker could then take control of the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.