# CVE-2021-43842: Stored XSS via SVG file upload in Wiki.js

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.4
- **CVSS:** 5.4 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: Low; User interaction: Required; Scope: Changed (impact reaches other components); Confidentiality impact: Low; Integrity impact: Low; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.74% (percentile 51, 2026-11-26)
- **CWE:** CWE-79
- **Published:** 2021-12-20T22:30:11.000Z
- **Modified:** 2026-06-17T04:11:33.150Z

## Who should check

- Anyone running Requarks wiki \< 2.5.258 (development); \< 2.5.260 (production)

## Description

Wiki.js is a wiki app built on Node.js. Wiki.js versions 2.5.257 and earlier are vulnerable to stored cross-site scripting through a SVG file upload. By creating a crafted SVG file, a malicious Wiki.js user may stage a stored cross-site scripting attack. This allows the attacker to execute malicious JavaScript when the SVG is viewed directly by other users. Scripts do not execute when loaded inside a page via normal \`\<img\>\` tags. Commit 5d3e81496fba1f0fbd64eeb855f30f69a9040718 fixes this vulnerability by adding an optional (enabled by default) SVG sanitization step to all file uploads that match the SVG mime type. As a workaround, disable file upload for all non-trusted users. Wiki.js version 2.5.260 is the first production version to contain a patch. Version 2.5.258 is the first development build to contain a patch and is available only as a Docker image as requarks/wiki:canary-2.5.258.

## Affected and fixed versions

- Requarks wiki: \< 2.5.258 (development); \< 2.5.260 (production) (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-43842. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-43842.md
Affected: Requarks wiki < 2.5.258 (development); < 2.5.260 (production)
Fixed in: Requarks wiki 2.5.258, Requarks wiki 2.5.260

Steps:
1. Search this machine and project for Requarks wiki: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-43842 being exploited?

There is no confirmed exploitation: CVE-2021-43842 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.74% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-43842?

Medium: CVSS 5.4 (v3.1, scored by CNA). Remote, login needed. A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2021-43842?

Requarks wiki \< 2.5.258 (development); \< 2.5.260 (production).

### Is there a fix for CVE-2021-43842?

Yes. Fixed in Requarks wiki 2.5.258, Requarks wiki 2.5.260. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2021-43842?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/Requarks/wiki/security/advisories/GHSA-3qv4-gp35-rgh7>
- patch: <https://github.com/Requarks/wiki/commit/5d3e81496fba1f0fbd64eeb855f30f69a9040718>
- other: <https://github.com/Requarks/wiki/releases/tag/2.5.260>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-43842>

HTML: <https://flawdb.com/CVE-2021-43842> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-43842>
