# GHSA-8c6x-g4fw-8rf4: Whatsapp-Chat-Exporter has Cross-Site Scripting vulnerability in HTML output of chats.

> An XSS vulnerability in WhatsApp-Chat-Exporter allows attackers to inject malicious scripts into exported HTML chat files, requiring user interaction to execute.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 10 Jul 2023

## What is GHSA-8c6x-g4fw-8rf4?

GHSA-8c6x-g4fw-8rf4 is a cross-site scripting vulnerability in Whatsapp-Chat-Exporter, published on 10 Jul 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

### Impact
A Cross-Site Scripting (XSS) vulnerability was found in the HTML output of chats. XSS is intended to be mitigated by Jinja's escape function. However, `autoescape=True` was missing when setting the environment. Although the actual impact is low, considering the HTML file is being viewed offline, an adversary may still be able to inject malicious payloads into the chat through WhatsApp. All users are affected.

### Patches
The vulnerability is patched in 0.9.5. All users are strongly advised to update the exporter to the latest version.

### Workarounds
No workaround is available. Please update the exporter to the latest version.

### References
https://github.com/KnugiHK/WhatsApp-Chat-Exporter/commit/bfdc68cd6ad53ceecf132773f9aaba50dd80fe79
https://owasp.org/www-community/attacks/xss/

## Which versions are affected by GHSA-8c6x-g4fw-8rf4?

2 open source packages ship an affected version, including Whatsapp-Chat-Exporter and whatsapp-chat-exporter.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `Whatsapp-Chat-Exporter` | PyPI | All versions | 0.9.5 |
| `whatsapp-chat-exporter` | PyPI | All versions | 0.9.5 |

## How do I fix GHSA-8c6x-g4fw-8rf4?

Upgrade Whatsapp-Chat-Exporter to 0.9.5 or later.

## Is GHSA-8c6x-g4fw-8rf4 being exploited?

There is no known exploitation of GHSA-8c6x-g4fw-8rf4 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-8c6x-g4fw-8rf4 and fix it if it is affected.

What it is: GHSA-8c6x-g4fw-8rf4 is a cross-site scripting vulnerability in Whatsapp-Chat-Exporter, published on 10 Jul 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-8c6x-g4fw-8rf4 in the wild and no public exploit code.

Affected packages and fixed versions:
- Whatsapp-Chat-Exporter (PyPI): affected all versions; fixed in 0.9.5
- whatsapp-chat-exporter (PyPI): affected all versions; fixed in 0.9.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-8c6x-g4fw-8rf4/ (Markdown: https://insights.sbomify.com/GHSA-8c6x-g4fw-8rf4/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-8c6x-g4fw-8rf4

---
From sbomify Insights: https://insights.sbomify.com/GHSA-8c6x-g4fw-8rf4/
Summaries are generated and may contain mistakes; the official description above is the record.
