# league/commonmark XSS: `on*` event-handler filter in `AttributesExtension` bypassed with a U+000C form feed

High severity, published 2026-09-01. Update league/commonmark to 2.9.1 or later: composer update league/commonmark.

Canonical URL: https://buzzphp.com/security/ghsa-f8fg-pg57-v4j8 · Data from GitHub as of 2026-11-25.

| | |
| --- | --- |
| Severity | high (CVSS 7.2) |
| Published | 2026-09-01 |
| Updated | 2026-09-01 |
| GHSA | [GHSA-f8fg-pg57-v4j8](https://github.com/advisories/GHSA-f8fg-pg57-v4j8) |
| Weakness | CWE-79, CWE-86 |

| Package | Affected versions | Fixed in |
| --- | --- | --- |
| league/commonmark | >= 2.7.0, < 2.9.1 | 2.9.1 |

## What to do

Update league/commonmark to 2.9.1 or later: composer update league/commonmark.

Check which version you run with `composer show league/commonmark`, and every affected package with `composer audit`.

## About this advisory

Summary

The AttributesExtension documents a security guarantee:

Note: Attributes starting with on (e.g. onclick or onerror) are capable of executing JavaScript code and are therefore never allowed by default. You must explicitly add them to the allow list if you want to use them.

— docs/2.x/extensions/attributes.md

Prefixing the attribute name with a single U+000C FORM FEED byte defeats that guarantee. {onclick="alert(1)"} passes through AttributesHelper::filterAttributes() untouched and is written verbatim into the output, where browsers parse it as a genuine onclick handler.



## Links

- [GHSA-f8fg-pg57-v4j8 on GitHub](https://github.com/advisories/GHSA-f8fg-pg57-v4j8)
- [All Composer security advisories](https://buzzphp.com/security)
