Vulnerabilities in pkg:npm/flood

PACKAGE
Advisory Summary

GHSA-r587-7jh2-4qr3 is a CRITICAL server secret was included vulnerability (General Security Weakness) affecting Flood libraries in the npm ecosystem. The issue involves server secret was included in static assets and served to clients. Remediation is available by upgrading affected packages to version 3.0.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/flood

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-r587-7jh2-4qr3 - CRITICAL Server secret was included in static assets and served to clients

GHSA-r587-7jh2-4qr3 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-r587-7jh2-4qr3
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Flood
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-r587-7jh2-4qr3

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

flood fixed: 3.0.0
npm install flood@3.0.0
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 flood

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-r587-7jh2-4qr3, inspect your project dependencies using npm:

npm ls flood

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

Note: The npm ls flood 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 General Security Weakness. In Flood, 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

### Impact Server JWT signing secret was included in static assets and served to clients. This ALLOWS Flood's builtin authentication to be bypassed. Given Flood is granted access to rTorrent's SCGI interface (which is unprotected and ALLOWS arbitrary code execution) and usually wide-ranging privileges to files, along with Flood's lack of security controls against authenticated users, the severity of this vulnerability is **CRITICAL**. ### Background Commit 8d11640b imported `config.js` to client (frontend) components to get `disableUsersAndAuth` configuration variable. Subsequently contents of `config.js` are compiled into static assets and served to users. Unfortunately `config.js` also includes `secret`. Intruders can use `secret` to sign authentication tokens themselves to bypass builtin access control of Flood. ### Patches Commit 042cb4ce removed imports of `config.js` from client (frontend) components. Additionally an eslint rule was added to prevent config.js from being imported to client (frontend) components. Commit 103f53c8 provided a general mitigation to this kind of problem by searching static assets to ensure `secret` is not included before starting server (backend). ### Workarounds Users shall upgrade if they use Flood's builtin authentication system. While maintainers will do their best to support it, Flood cannot guarantee its in-house access control system can stand against determined attackers in high-stake environments. > Use `HTTP Basic Auth` or other battle-hardened authentication methods instead of Flood's in-house one. You can use `disableUsersAndAuth` to avoid duplicate authentication. Users are advised to check out the [wiki](https://github.com/jesec/flood/wiki) for more information on security precautions. ### References [Wiki - Security precautions](https://github.com/jesec/flood/wiki/Security-precautions) [Introduction to JSON Web Tokens](https://jwt.io/introduction/) ### For more information If you have any questions or comments about this advisory: * Open an issue in [issue tracker](https://github.com/jesec/flood/issues) * Email us at [jc@linux.com](mailto:jc@linux.com)

GHSA-r587-7jh2-4qr3 Affected Flood Versions

1 component(s)
Fixed Versions:
3.0.0
Product / Package Ecosystem Affected Versions Fixed Version
flood
npm
≥ 2.0.0
< 3.0.0
3.0.0

References

Frequently Asked Questions

What is GHSA-r587-7jh2-4qr3?
GHSA-r587-7jh2-4qr3 is a security vulnerability in Flood involving Server secret was included in static assets and served to clients under General Security Weakness.
Which Flood versions are affected?
Affected versions include releases prior to 3.0.0 across affected packages: flood.
What version fixes GHSA-r587-7jh2-4qr3?
Upgrading to 3.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is flood affected?
Yes, flood is affected in releases prior to 3.0.0. Upgrade your dependency to 3.0.0 or later.
What CWE is associated with GHSA-r587-7jh2-4qr3?
GHSA-r587-7jh2-4qr3 is classified under General Security Weakness.
How can I check npm dependencies for GHSA-r587-7jh2-4qr3?
Run the dependency tree command: 'npm ls flood'. 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-r587-7jh2-4qr3",
  "modified" : "2022-09-09T20:56:50Z",
  "published" : "2020-08-26T19:32:50Z",
  "aliases" : [ ],
  "summary" : "Server secret was included in static assets and served to clients",
  "details" : "### Impact\nServer JWT signing secret was included in static assets and served to clients.\n\nThis ALLOWS Flood's builtin authentication to be bypassed. Given Flood is granted access to rTorrent's SCGI interface (which is unprotected and ALLOWS arbitrary code execution) and usually wide-ranging privileges to files, along with Flood's lack of security controls against authenticated users, the severity of this vulnerability is **CRITICAL**. \n\n### Background\nCommit 8d11640b imported `config.js` to client (frontend) components to get `disableUsersAndAuth` configuration variable. Subsequently contents of `config.js` are compiled into static assets and served to users. Unfortunately `config.js` also includes `secret`.\n\nIntruders can use `secret` to sign authentication tokens themselves to bypass builtin access control of Flood.\n\n### Patches\nCommit 042cb4ce removed imports of `config.js` from client (frontend) components. Additionally an eslint rule was added to prevent config.js from being imported to client (frontend) components.\n\nCommit 103f53c8 provided a general mitigation to this kind of problem by searching static assets to ensure `secret` is not included before starting server (backend). \n\n### Workarounds\nUsers shall upgrade if they use Flood's builtin authentication system.\n\nWhile maintainers will do their best to support it, Flood cannot guarantee its in-house access control system can stand against determined attackers in high-stake environments. \n\n> Use `HTTP Basic Auth` or other battle-hardened authentication methods instead of Flood's in-house one. You can use `disableUsersAndAuth` to avoid duplicate authentication.\n\nUsers are advised to check out the [wiki](https://github.com/jesec/flood/wiki) for more information on security precautions.\n\n### References\n[Wiki - Security precautions](https://github.com/jesec/flood/wiki/Security-precautions)\n\n[Introduction to JSON Web Tokens](https://jwt.io/introduction/)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [issue tracker](https://github.com/jesec/flood/issues)\n* Email us at [jc@linux.com](mailto:jc@linux.com)",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "flood"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "3.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jesec/flood/security/advisories/GHSA-r587-7jh2-4qr3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jesec/flood/commit/103f53c8d2963584e41bcf46ccc6fe0fabf179ca"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jesec/flood/commit/d137107ac908526d43966607149fbaf00cfcedf0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jesec/flood"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-26T19:32:37Z",
    "nvd_published_at" : null
  }
}