CVE-2021-25978: Cross-site Scripting in apostrophe

apostrophe Updated 02 Oct 2025

Summary

10/11/2021
Yes i
Moderate
5.4

CVE-2021-25978: Cross-site Scripting in apostrophe. Affects apostrophe versions >= 2.63.0, < 3.4.0. Fixed in 3.4.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Apostrophe CMS is an open-source content management system built on Node.js and MongoDB. It provides a flexible and user-friendly interface for managing website content. The vulnerability affects versions 2.63.0 to 3.3.1 of the apostrophe package. Apostrophe allows editors to upload SVG files to the Images module, which can be used to display images on the website. However, due to a lack of proper input sanitization, an attacker can upload an SVG file containing malicious JavaScript code. When viewed, this code is executed in the context of the user's browser, leading to a stored cross-site scripting (XSS) vulnerability.

Vulnerability Detail

The stored XSS vulnerability in apostrophe CMS allows an attacker to upload a specially crafted SVG file containing malicious JavaScript code. When the file is viewed by a user, the code is executed in the user's browser, potentially allowing the attacker to perform actions on behalf of the user, steal sensitive information, or manipulate the website's content. The vulnerability has a CVSS score of 5.4, indicating a moderate severity level.

How To Fix

Latest published version: 4.34.0 as of 23 Oct 2026

npm install apostrophe@4.34.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.4.0

This is the first release that contains the fix.

npm install apostrophe@3.4.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can disable the upload functionality for SVG files in the Images module. This can be done by modifying the code responsible for handling file uploads and adding a validation check to disallow SVG files. Here is an example of how the code can be modified:

// Add the following check before processing the uploaded file
if (file.type === 'image/svg+xml') {
  throw new Error('SVG file uploads are currently disabled.');
}

Conclusion

The stored XSS vulnerability in apostrophe CMS versions 2.63.0 to 3.3.1 can allow an attacker to execute malicious JavaScript code in the context of a user's browser. To mitigate this issue, it is recommended to upgrade to version 3.4.0 or later of the apostrophe package. Additionally, a temporary workaround is available by disabling SVG file uploads in the Images module. For further support and assistance, please contact DevNack.com.

See every vulnerability recorded for apostrophe →

Share this vulnerability

FAQ

The vulnerability allows an attacker to execute arbitrary JavaScript code in the context of a user's browser, potentially leading to unauthorized actions, data theft, or content manipulation.

No, only versions between 2.63.0 and 3.3.1 are vulnerable. It is recommended to upgrade to version 3.4.0 or later to mitigate the issue.

Yes, you can temporarily disable SVG file uploads in the Images module to mitigate the vulnerability. However, it is still recommended to upgrade to the latest version for a permanent fix.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your package-lock.json file and Vulert will analyze it for vulnerabilities in real-time.

For further support and assistance in remediating this vulnerability, you can reach out to info@devnack.com. Our team of experts will be happy to assist you.

Related vulnerabilities

Recent vulnerabilities recorded for apostrophe.

How To Fix

Latest published version: 4.34.0 as of 23 Oct 2026

npm install apostrophe@4.34.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.4.0

This is the first release that contains the fix.

npm install apostrophe@3.4.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback