CVE-2025-31695 Link field display mode formatter - Moderately critical - Cross site scripting - SA-CONTRIB-2025-024
An attacker can inject malicious scripts via the Link field display mode formatter in Drupal, potentially compromising user sessions.
- 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
What is CVE-2025-31695?
CVE-2025-31695 is a medium-severity cross-site scripting vulnerability in Drupal Link field display mode formatter, published on 31 Mar 2025. 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
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Drupal Link field display mode formatter allows Cross-Site Scripting (XSS).This issue affects Link field display mode formatter: from 0.0.0 before 1.6.0.
Weakness: CWE-79
Which versions are affected by CVE-2025-31695?
2 open source packages ship an affected version, including drupal/link_field_display_mode_formatter. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
drupal/link_field_display_mode_formatter Packagist | All versions | 1.6.0 |
drupal/link_field_display_mode_formatter Packagist | All versions | 1.6.0 |
Linux distribution packages (1)
drupal/link_field_display_mode_formatter Packagist:https://packages.drupal.org/8 | All versions | 1.6.0 |
Products include Upstreamable Link Field Display Mode Formatter.
How do I fix CVE-2025-31695?
Upgrade drupal/link_field_display_mode_formatter to 1.6.0 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2025-31695 being exploited?
There is no known exploitation of CVE-2025-31695 in the wild and no public exploit code.
Sources
Also known as DRUPAL-CONTRIB-2025-024, GHSA-p2wg-8h29-874v.