Vulnerabilities in pkg:npm/hfs

PACKAGE
Advisory Summary

GHSA-xcxh-6cv4-q8p8 is a LOW hfs user adding a "web vulnerability (CWE-1022: Use of Web Link to Untrusted Target with window.opener Access) affecting Hfs libraries in the npm ecosystem. The issue involves hfs user adding a "web link" in hfs is vulnerable to "target=_blank" exploit. Remediation is available by upgrading affected packages to version 0.57.10.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/hfs

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/hfs. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-xcxh-6cv4-q8p8 - LOW HFS user adding a "web link" in HFS is vulnerable to "target=_blank" exploit
GHSA-5f4x-hwv2-w9w2 CVE-2024-39943 HIGH rejetto HFS vulnerable to OS Command Execution by remote authenticated users

GHSA-xcxh-6cv4-q8p8 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-xcxh-6cv4-q8p8
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-1022: Use of Web Link to Untrusted Target with window.opener Access
Affected Product Hfs
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-xcxh-6cv4-q8p8

To remediate this vulnerability, upgrade all affected Hfs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

hfs fixed: 0.57.10
npm install hfs@0.57.10
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls hfs

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-xcxh-6cv4-q8p8, inspect your project dependencies using npm:

npm ls hfs

Analyze the terminal output to locate any version of Hfs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.57.10), your application is affected.

Note: The npm ls hfs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1022: Use of Web Link to Untrusted Target with window.opener Access, where the web application produces links to untrusted external sites outside of its sphere of control, but it does not properly prevent the external site from modifying security-critical properties of the window.opener object, such as the location property. In Hfs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary When adding a "web link" to the HFS virtual filesystem, the frontend opens it with `target="_blank"` but without the `rel="noopener noreferrer"` attribute. This allows the opened page to use the `window.opener` property to change the location of the original HFS tab. ### Details While most modern browsers have fixes already implemented for this `target="_blank"` exploit at the browser level, users on outdated browsers remain vulnerable. This means that if an admin of the HFS instance adds a link to an external third-party service (that they believe is safe at the time) and that service they added later becomes compromised, the malicious page could replace the original HFS tab's content with a phishing page. This does not require the admin account itself to be compromised, only that a legitimate linked site turns malicious. ### Impact Affected users (people using old browsers without the browser level fix) could be misled into entering their HFS credentials or other sensitive information into a fake site controlled by an attacker. This vulnerability is fixed in most modern browsers, but adding `rel="noopener noreferrer"` remains a best practice to protect legacy environments. ### PoC Firstly, in the HFS admin page, under the filesystem (/~/admin/#/fs) press "Add" then "web link" then set the link to take the user to to an HTML file that exploits this vulnerability, here is an example of a malicious HTML file's code: ```<html> <body> <script> window.opener.location = "https://example.org"; </script> <b>Error loading...</b> </body> </html> ``` Now, in the HFS folder you placed this web link in, open HFS and click the web link, if you aren't on a modern browser that fixed this vulnerability on the browser level, then switch back to the HFS tab that opened it, and you should be taken to "https://example.org" if you tried the code I provided, or whatever other page you tried.

GHSA-xcxh-6cv4-q8p8 Affected Hfs Versions

1 component(s)
Fixed Versions:
0.57.10
Product / Package Ecosystem Affected Versions Fixed Version
hfs
npm
< 0.57.10
0.57.10

References

Frequently Asked Questions

What is GHSA-xcxh-6cv4-q8p8?
GHSA-xcxh-6cv4-q8p8 is a security vulnerability in Hfs involving HFS user adding a "web link" in HFS is vulnerable to "target=_blank" exploit under CWE-1022: Use of Web Link to Untrusted Target with window.opener Access.
Which Hfs versions are affected?
Affected versions include releases prior to 0.57.10 across affected packages: hfs.
What version fixes GHSA-xcxh-6cv4-q8p8?
Upgrading to 0.57.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hfs affected?
Yes, hfs is affected in releases prior to 0.57.10. Upgrade your dependency to 0.57.10 or later.
What CWE is associated with GHSA-xcxh-6cv4-q8p8?
GHSA-xcxh-6cv4-q8p8 is classified under CWE-1022: Use of Web Link to Untrusted Target with window.opener Access (The web application produces links to untrusted external sites outside of its sphere of control, but it does not properly prevent the external site from modifying security-critical properties of the window.opener object, such as the location property.).
How can I check npm dependencies for GHSA-xcxh-6cv4-q8p8?
Run the dependency tree command: 'npm ls hfs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xcxh-6cv4-q8p8",
  "modified" : "2025-08-12T20:23:55Z",
  "published" : "2025-08-12T00:13:03Z",
  "aliases" : [ ],
  "summary" : "HFS user adding a \"web link\" in HFS is vulnerable to \"target=_blank\" exploit",
  "details" : "### Summary\nWhen adding a \"web link\" to the HFS virtual filesystem, the frontend opens it with `target=\"_blank\"` but without the `rel=\"noopener noreferrer\"` attribute. This allows the opened page to use the `window.opener` property to change the location of the original HFS tab.\n\n### Details\nWhile most modern browsers have fixes already implemented for this `target=\"_blank\"` exploit at the browser level, users on outdated browsers remain vulnerable. This means that if an admin of the HFS instance adds a link to an external third-party service (that they believe is safe at the time) and that service they added later becomes compromised, the malicious page could replace the original HFS tab's content with a phishing page. This does not require the admin account itself to be compromised, only that a legitimate linked site turns malicious.\n\n### Impact\nAffected users (people using old browsers without the browser level fix) could be misled into entering their HFS credentials or other sensitive information into a fake site controlled by an attacker. This vulnerability is fixed in most modern browsers, but adding `rel=\"noopener noreferrer\"` remains a best practice to protect legacy environments.\n\n\n### PoC\n\nFirstly, in the HFS admin page, under the filesystem (/~/admin/#/fs) press \"Add\" then \"web link\" then set the link to take the user to to an HTML file that exploits this vulnerability, here is an example of a malicious HTML file's code:\n\n```<html>\n <body>\n  <script>\n    window.opener.location = \"https://example.org\";\n  </script>\n<b>Error loading...</b>\n </body>\n</html>\n```\n\nNow, in the HFS folder you placed this web link in, open HFS and click the web link, if you aren't on a modern browser that fixed this vulnerability on the browser level, then switch back to the HFS tab that opened it, and you should be taken to \"https://example.org\" if you tried the code I provided, or whatever other page you tried.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "hfs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.57.10"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.57.9"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rejetto/hfs/security/advisories/GHSA-xcxh-6cv4-q8p8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rejetto/hfs/commit/6531bcd2ab285af88f91831e30d8a03f5b9fe20d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rejetto/hfs"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1022" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-12T00:13:03Z",
    "nvd_published_at" : null
  }
}