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

Source: https://junglewise.ai/threats/cve-2021-21278-rsshub-code-injection-via-eval-and-function-constructor  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-10-12. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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

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.

Technologies: [rsshub (npm)](https://junglewise.ai/threats/technologies/rsshub). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2021-21278 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-21278 being exploited in the wild.

**How severe is CVE-2021-21278?** Low severity, with a CVSS score of 3.1, published 12 October 2021.

**Which products and versions are affected?** rsshub (npm) SEMVER:introduced=0,last_affected=1.0.0.

**Is there a fix for CVE-2021-21278?** A patch was published on 2021-01-26: Patched in commit 7f1c430 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2021-21278 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2021-21278?** Check whether you run rsshub (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## 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)

## Identifiers

- CVE-2021-21278
- GHSA-pgjj-866w-fc5c

## 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

- [https://github.com/DIYgod/RSSHub/security/advisories/GHSA-pgjj-866w-fc5c](https://github.com/DIYgod/RSSHub/security/advisories/GHSA-pgjj-866w-fc5c)

## Related threats

- [RSSHub SSRF in Mastodon, Zjol, and M4 routes](https://junglewise.ai/threats/cve-2024-27927-rsshub-ssrf-in-mastodon-zjol-and-m4-routes)
- [DIYgod RSSHub XSS in internal media proxy](https://junglewise.ai/threats/cve-2024-27926-diygod-rsshub-xss-in-internal-media-proxy)
- [DIYgod RSSHub cross-site scripting in brief parameter](https://junglewise.ai/threats/cve-2023-26491-diygod-rsshub-cross-site-scripting-in-brief-parameter)
- [RSSHub server-side request forgery](https://junglewise.ai/threats/cve-2023-22493-rsshub-server-side-request-forgery)
- [RSSHub denial of service in filter parameters](https://junglewise.ai/threats/cve-2022-31110-rsshub-denial-of-service-in-filter-parameters)
