CVE-2021-21278: Rsshub Risk Of Code Injection Vulnerability

HIGH
Advisory Identifier: GHSA-pgjj-866w-fc5c
CVSS 8.6
CWE-74
Published
Advisory Summary

CVE-2021-21278 is a HIGH (CVSS 8.6) risk of code injection vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Rsshub libraries in the npm ecosystem. The issue involves risk of code injection. Remediation is available in the latest vendor maintenance releases.

CVE-2021-21278 at a Glance

CVE Identifier CVE-2021-21278
GHSA Identifier GHSA-pgjj-866w-fc5c
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Rsshub
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-21278

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

rsshub fixed: Latest secure release
npm install rsshub@Latest secure release
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 rsshub

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-21278, inspect your project dependencies using npm:

npm ls rsshub

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

Note: The npm ls rsshub 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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Rsshub, 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 Some routes use `eval` or `Function constructor`, which may be injected by the target site with unsafe code, causing server-side security issues ### Patches Temporarily removed the problematic route and added a `no-new-func` rule to eslint Self-built users should upgrade to 7f1c430 and later as soon as possible ### Credits Tencent Woodpecker Security Team ### For more information If you have any questions or comments about this advisory: * Open an issue in [https://github.com/DIYgod/RSSHub/issues](https://github.com/DIYgod/RSSHub/issues) * Email us at [i@diygod.me](mailto:i@diygod.me)

CVE-2021-21278 Affected Rsshub Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
rsshub
npm
≤ 1.0.0

References

Frequently Asked Questions

What is CVE-2021-21278?
CVE-2021-21278 is a security vulnerability in Rsshub involving Risk of code injection under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Rsshub versions are affected?
Affected versions include releases prior to current release patches across affected packages: rsshub.
What version fixes CVE-2021-21278?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is rsshub affected?
Yes, rsshub is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2021-21278?
CVE-2021-21278 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2021-21278?
CVE-2021-21278 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2021-21278?
Run the dependency tree command: 'npm ls rsshub'. 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-pgjj-866w-fc5c",
  "modified" : "2021-10-11T16:14:26Z",
  "published" : "2021-10-12T16:03:43Z",
  "aliases" : [ "CVE-2021-21278" ],
  "summary" : "Risk of code injection",
  "details" : "### Impact\nSome routes use `eval` or `Function constructor`, which may be injected by the target site with unsafe code, causing server-side security issues\n\n### Patches\nTemporarily removed the problematic route and added a `no-new-func` rule to eslint\nSelf-built users should upgrade to 7f1c430 and later as soon as possible\n\n### Credits\nTencent Woodpecker Security Team\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [https://github.com/DIYgod/RSSHub/issues](https://github.com/DIYgod/RSSHub/issues)\n* Email us at [i@diygod.me](mailto:i@diygod.me)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "rsshub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/DIYgod/RSSHub/security/advisories/GHSA-pgjj-866w-fc5c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21278"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/DIYgod/RSSHub/commit/7f1c43094e8a82e4d8f036ff7d42568fed00699d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/DIYgod/RSSHub"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/rsshub"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-10-11T16:14:26Z",
    "nvd_published_at" : "2021-01-26T21:15:00Z"
  }
}