Cross-site Request Forgery (CSRF) Affecting hfs package, versions <3.2.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.18% (8th percentile)

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 Cross-site Request Forgery (CSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-HFS-17970330
  • published14 Jul 2026
  • disclosed13 Jul 2026
  • creditZach Hanley

Introduced: 13 Jul 2026

NewCVE-2026-61502  (opens in a new tab)
CWE-352  (opens in a new tab)

How to fix?

Upgrade hfs to version 3.2.1 or higher.

Overview

hfs is a HTTP File Server

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) via the apiMiddleware request filter in src/apiMiddleware.ts. An attacker can create accounts or change configuration by causing a logged-in administrator’s browser to send a state-changing API request with the GET method and no x-hfs-anti-csrf header. The vulnerable middleware treated non-POST requests as CSRF-safe, so browser-triggered GET API calls bypassed the anti-CSRF check and reached administrative handlers such as add_account. In default deployments, the same flaw allows a remote attacker to trigger administrative actions without credentials if the request originates from the server’s own machine.

CVSS Base Scores

version 4.0
version 3.1