npm package

ejs 2.4.2 vulnerabilities, and the version that fixes all of them

ejs 2.4.2 has 5 known vulnerabilities (3 rated high or critical); 3.1.10 fixes all of them. The maintainers deprecated this release.

npm (opens in a new tab) describes it as “Embedded JavaScript templates”

Known vulnerabilities
5
3 rated high or critical
Released
May 24, 2016
Latest is 7.0.1
Downloads last week
1.3K
Under 1% of ejs downloads
Licence
Apache-2.0
OpenSSF Scorecard
2.9/10
mde/ejs (opens in a new tab)
Dependencies
None
Resolved by deps.dev
Status
Deprecated release

What to upgrade to

3.1.10 is the closest release with no known vulnerabilities.

  • 2.7.4

    Newest 2.x release. Released Nov 19, 2019.

    2 known vulnerabilities, worst rated warning
  • 3.1.10Upgrade to this

    Fixes all 5 known vulnerabilities. Released Apr 12, 2024.

    No known vulnerabilities
  • 7.0.1

    Latest release. Released Oct 4, 2026.

    No known vulnerabilities

Hand the fix to your coding agent

One task with the upgrade, the file to change and why. Paste it into Claude Code, Cursor or Codex.

Findings

Every advisory for ejs 2.4.2

Known exploited first (CISA KEV), then by how likely they are to be exploited (FIRST EPSS), then by severity. Each id links to its OSV.dev record.

  1. CriticalCVE-2022-29078 on OSV.dev (opens in a new tab)GHSA-phwq-j96m-2c2qEPSS: top 2%

    ejs template injection vulnerability

    Fixed in 3.1.7. Published Apr 26, 2022.

  2. CriticalCVE-2017-1000228 on OSV.dev (opens in a new tab)GHSA-3w5v-p54c-f74xEPSS: top 7%

    ejs is vulnerable to remote code execution due to weak input validation

    Fixed in 2.5.5. Published Nov 30, 2017.

  3. CriticalCVE-2017-1000189 on OSV.dev (opens in a new tab)GHSA-6x77-rpqf-j6mwEPSS: top 18%

    ejs vulnerable to DoS due to weak input validation

    Fixed in 2.5.5. Published Mar 5, 2018.

  4. WarningCVE-2017-1000188 on OSV.dev (opens in a new tab)GHSA-hwcf-pp87-7x6pEPSS: top 32%

    mde ejs vulnerable to XSS

    Fixed in 2.5.5. Published Nov 30, 2017.

  5. WarningCVE-2024-33883 on OSV.dev (opens in a new tab)GHSA-ghr5-ch3p-vcr6EPSS: top 52%

    ejs lacks certain pollution protection

    Fixed in 3.1.10. Published Apr 28, 2024.

Who is still on a vulnerable ejs

9% of last week’s 43.4M ejs downloads went to versions with known vulnerabilities.

From npm’s per-version download counts for the last 7 days, each version checked against OSV.dev. The versions checked cover over 99% of downloads.

Is ejs the only one?

Paste a public GitHub repo or drop your package.json and see every vulnerable, end-of-life or deprecated dependency, with one fix task. Free, no sign-up.

Check your whole repo

How this page is checked

StackPrism asks OSV.dev which advisories affect exactly ejs 2.4.2, merges duplicates filed under several ids, and ranks them with CISA’s Known Exploited Vulnerabilities list and FIRST EPSS. Release dates and deprecation come from deps.dev and npm. No AI writes this page: every sentence comes from that data, refreshed every few hours.

Last checked against npm, OSV.dev, deps.dev, CISA KEV and FIRST EPSS.