Junglewise Threat Intelligence

CVE-2021-21278: RSSHub code injection via eval and Function constructor

CVE-2021-21278 · Severity: low · CVSS 3.1 · Published 2021-10-12

Technologies: DIYgod Rsshub. Vendors: npm.

Executive brief

RSSHub is a popular RSS feed aggregator and converter that runs on application servers. The vulnerability allows attackers to inject and execute arbitrary code on the server by targeting routes that use the JavaScript eval() function or Function constructor without proper input validation. This could allow an attacker to take complete control of the server and access sensitive data.

Technical details

RSSHub versions up to e8beb40 contain a code injection vulnerability (CWE-74) in routes that use eval() or the Function constructor to process user-supplied input. The vulnerability requires network access but no authentication or user interaction. An attacker can craft a malicious request to inject arbitrary JavaScript code, which will be executed on the server with full application privileges. The patch (commit 7f1c430) removes the problematic routes and adds eslint rules (no-new-func) to prevent similar patterns. Users running self-built versions should upgrade immediately.

Affected products

  • DIYgod RSSHub up to 1.0.0 (commit e8beb40 or before)

Timeline

  • 2021-01-26: disclosed: CVE-2021-21278 published on NVD
  • 2021-10-12: advisory: GHSA-pgjj-866w-fc5c published
  • 2021-01-26: patched: Patched in commit 7f1c430

References

Related threats