# GHSA-w67g-2h6v-vjgq: Phlex XSS protection bypass via attribute splatting, dynamic tags, and href values

> Attackers can bypass XSS protections in Phlex via attribute splatting, dynamic tags, or href values, requiring user interaction to execute scripts.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 Feb 2026

## What is GHSA-w67g-2h6v-vjgq?

GHSA-w67g-2h6v-vjgq is a cross-site scripting vulnerability in phlex, published on 6 Feb 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

### Impact

During a security audit conducted with Claude Opus 4.6 and GPT-5.3-Codex, we identified three specific ways to bypass the XSS (cross-site-scripting) protection built into Phlex.

1. The first bypass could happen if user-provided attributes with string keys were splatted into HTML tag, e.g. `div(**user_attributes)`.
2. The second bypass could happen if user-provided tag names were passed to the `tag` method, e.g. `tag(some_tag_name_from_user)`.
3. The third bypass could happen if user’s links were passed to `href` attributes, e.g. `a(href: user_provided_link)`.

All three of these patterns are meant to be safe and all have now been patched.

### Patches

Phlex has patched all three issues and introduced new tests that run against Safari, Firefox and Chrome.

The patched versions are:

- [2.4.1](https://rubygems.org/gems/phlex/versions/2.4.1)
- [2.3.2](https://rubygems.org/gems/phlex/versions/2.3.2)
- [2.2.2](https://rubygems.org/gems/phlex/versions/2.2.2)
- [2.1.3](https://rubygems.org/gems/phlex/versions/2.1.3)
- [2.0.2](https://rubygems.org/gems/phlex/versions/2.0.3)
- [1.11.1](https://rubygems.org/gems/phlex/versions/1.11.1)

Phlex has also patched the [`main`](https://github.com/yippee-fun/phlex) branch in GitHub.

### Workarounds
If a project uses a secure CSP (content security policy) or if the application doesn’t use any of the above patterns, it is not at risk.

## Which versions are affected by GHSA-w67g-2h6v-vjgq?

12 open source packages ship an affected version, including phlex.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `phlex` | RubyGems | All versions | 1.11.1 |
| `phlex` | RubyGems | All versions | 1.11.1 |
| `phlex` | RubyGems | From 2.0.0.beta1 | 2.0.2 |
| `phlex` | RubyGems | From 2.0.0.beta1 | 2.0.2 |
| `phlex` | RubyGems | From 2.1.0 | 2.1.3 |
| `phlex` | RubyGems | From 2.1.0 | 2.1.3 |
| `phlex` | RubyGems | From 2.2.0 | 2.2.2 |
| `phlex` | RubyGems | From 2.2.0 | 2.2.2 |
| `phlex` | RubyGems | From 2.3.0 | 2.3.2 |
| `phlex` | RubyGems | From 2.3.0 | 2.3.2 |
| `phlex` | RubyGems | From 2.4.0.beta1 | 2.4.1 |
| `phlex` | RubyGems | From 2.4.0.beta1 | 2.4.1 |

## How do I fix GHSA-w67g-2h6v-vjgq?

Upgrade phlex to a fixed version for your release line: 1.11.1, 2.0.2, 2.1.3 or 2.2.2.

## Is GHSA-w67g-2h6v-vjgq being exploited?

There is no known exploitation of GHSA-w67g-2h6v-vjgq in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-w67g-2h6v-vjgq and fix it if it is affected.

What it is: GHSA-w67g-2h6v-vjgq is a cross-site scripting vulnerability in phlex, published on 6 Feb 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-w67g-2h6v-vjgq in the wild and no public exploit code.

Affected packages and fixed versions:
- phlex (RubyGems): affected all versions; fixed in 1.11.1
- phlex (RubyGems): affected all versions; fixed in 1.11.1
- phlex (RubyGems): affected from 2.0.0.beta1; fixed in 2.0.2
- phlex (RubyGems): affected from 2.0.0.beta1; fixed in 2.0.2
- phlex (RubyGems): affected from 2.1.0; fixed in 2.1.3
- phlex (RubyGems): affected from 2.1.0; fixed in 2.1.3
- phlex (RubyGems): affected from 2.2.0; fixed in 2.2.2
- phlex (RubyGems): affected from 2.2.0; fixed in 2.2.2
- phlex (RubyGems): affected from 2.3.0; fixed in 2.3.2
- phlex (RubyGems): affected from 2.3.0; fixed in 2.3.2
- phlex (RubyGems): affected from 2.4.0.beta1; fixed in 2.4.1
- phlex (RubyGems): affected from 2.4.0.beta1; fixed in 2.4.1

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-w67g-2h6v-vjgq/ (Markdown: https://insights.sbomify.com/GHSA-w67g-2h6v-vjgq/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-w67g-2h6v-vjgq

---
From sbomify Insights: https://insights.sbomify.com/GHSA-w67g-2h6v-vjgq/
Summaries are generated and may contain mistakes; the official description above is the record.
