Arbitrary Code Execution in json-ptr

json-ptr Updated 02 Oct 2025

Summary

26/05/2021
HIGH
Yes i
High
Not published

GHSA-rrqv-vjrw-hrcr: Arbitrary Code Execution in json-ptr. Affects json-ptr versions < 2.1.0. Fixed in 2.1.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The json-ptr package is an npm package that provides functionality for working with JSON Pointers. JSON Pointers are a way to reference specific values within a JSON document. The package allows users to manipulate and retrieve values from JSON documents using these pointers. However, versions prior to v2.1.0 of json-ptr are vulnerable to an arbitrary code execution vulnerability.

Vulnerability Detail

The vulnerability in json-ptr versions prior to v2.1.0 allows an unscrupulous actor to execute arbitrary code. If user input is not properly sanitized before being passed to the .get() method of json-ptr, an injection-style vulnerability can be exploited. This can lead to unauthorized code execution and potentially enable an attacker to gain control over the affected system. The vulnerability has been assigned a severity rating of HIGH and is categorized under CWE-74.

How To Fix

Minimum fixed version

2.1.0

This is the first release that contains the fix.

npm install json-ptr@2.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, a possible workaround is to ensure that all user input passed to the .get() method is properly sanitized and validated. This can be achieved by implementing input validation and sanitization techniques, such as using a JSON schema validator or carefully parsing and validating the input before passing it to the .get() method.

Conclusion

In conclusion, the json-ptr package prior to v2.1.0 is vulnerable to arbitrary code execution. It is crucial to upgrade to the latest version or apply proper input validation and sanitization techniques to mitigate the risk. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for json-ptr →

Share this vulnerability

FAQ

json-ptr is an npm package that provides functionality for working with JSON Pointers. JSON Pointers are a way to reference specific values within a JSON document.

The vulnerability in json-ptr versions prior to v2.1.0 allows an unscrupulous actor to execute arbitrary code by injecting malicious input into the .get() method.

The vulnerability can lead to unauthorized code execution and potentially enable an attacker to gain control over the affected system.

To fix the vulnerability, it is recommended to upgrade to json-ptr version 2.1.0 or later.

If upgrading to the latest version is not immediately feasible, a possible workaround is to ensure that all user input passed to the .get() method is properly sanitized and validated.

Related vulnerabilities

Recent vulnerabilities recorded for json-ptr.

How To Fix

Minimum fixed version

2.1.0

This is the first release that contains the fix.

npm install json-ptr@2.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback