Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

path-sanitizer

Latest version: v5.0.0

Overview

Last scanned
31 Oct 2026
Published
31 Oct 2026
npm package Publisher: greencoder001
4 Stars
1 Forks
3 Versions
13.4K Downloads
TypeScript Repo language

Scan summary

path-sanitizer was last scanned on 31 Oct 2026 at version 5.0.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 3 versions; the latest was published on 31 Oct 2026.
  • Findings: No rules fired in version 5.0.0.
  • Downloads: 13,449 downloads.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
5.0.0 LATEST 31 Oct 2026 No rules fired
4.0.4 24 Oct 2026 No rules fired
4.0.3 24 Oct 2026 No rules fired

No rules fired in 5.0.0

Findings

Findings for v5.0.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 5.0.0; other versions have their own rules, not their own score.

Known vulnerabilities

1 CVE · last 31 Dec 2024

1 CRITICAL 0 HIGH 0 MEDIUM 0 LOW

Versions

  • ≥ 3.1.0
  • < 3.1.0 1 CRITICAL

Vulnerabilities

  • CVE-2024-56198 Critical 31 Dec 2024 path-sanitizer allows bypassing the existing filters to achieve path-traversal vulnerability Fixed in 3.1.0

README

The publisher’s own README, as collected from the registry.

path-sanitizer

A simple lightweight npm package for sanitizing paths to prevent Path Traversal

Usage

import sanitize from 'path-sanitizer'
// or in a common js environment
const sanitize = (await import('path-sanitizer')).default

console.log(sanitize('path/to/file.txt'))

Or here is a more complex example:

import sanitize from 'path-sanitizer'
import path from 'path'

// Real scenario:
function routeHandler(myPath) {
  // Lets just assume that the path was extracted from the request
  // We want to read a file in the /home/user/server/static/ directory
  // But the user should not be able to access /home/user/server/
  // So we need to sanitize the path

  const APP_DIR = '/home/user/server/static/'
  const sanitized = path.join(APP_DIR, sanitize(myPath))

  // Now we would usually read the file
  // But in this case we will just print the path
  console.log(sanitized)
}

routeHandler('my-video.mp4') // Just fine...
routeHandler('../../Documents/personal-file.pdf') // But what if we try to access a file outside the app directory?
routeHandler('/home/user/hello.txt') // What if the path starts with a slash, and we try to use an absolute path?
routeHandler('////////a\\\\../hi.txt') // What if the path is not valid?
routeHandler(500) // What if the path is not a string?
routeHandler('/:11^^') // What if the path contains not allowed characters (like ":")?

Note

This package is optimized for linux environments. You can try to use it on Windows, and it will mostly work fine, but it is recommended to use on a linux system or inside a docker container.

Contributing

If you have any issues with path-sanitizer or you have discovered a vulnerability / bypass, please make sure to report it. I appreciate every contribution.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm path-sanitizer

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Frame 2085668439 (1)
Group 1261154229