GHSA-r587-7jh2-4qr3: Flood Server Secret Was Included Vulnerability
CRITICALGHSA-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.
GHSA-r587-7jh2-4qr3 at a Glance
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.
npm install flood@3.0.0
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
GHSA-r587-7jh2-4qr3 Affected Flood Versions
1 component(s)| 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?
Which Flood versions are affected?
What version fixes GHSA-r587-7jh2-4qr3?
Is flood affected?
What CWE is associated with GHSA-r587-7jh2-4qr3?
How can I check npm dependencies for GHSA-r587-7jh2-4qr3?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}