CVE-2025-13981

4.4 MEDIUM

📋 TL;DR

This Cross-Site Scripting (XSS) vulnerability in Drupal AI modules allows attackers to inject malicious scripts into web pages viewed by other users. It affects Drupal sites using AI modules in vulnerable versions. Attackers could steal session cookies, redirect users, or perform actions on their behalf.

💻 Affected Systems

Products:
  • Drupal AI (Artificial Intelligence) module
Versions: 0.0.0 to 1.0.6, 1.1.0 to 1.1.6, 1.2.0 to 1.2.3
Operating Systems: All operating systems running Drupal
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Drupal sites with AI modules installed and enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers steal administrator session cookies, gain full control of the Drupal site, install backdoors, or deface the website.

🟠

Likely Case

Attackers steal user session cookies, perform actions as authenticated users, or redirect users to malicious sites.

🟢

If Mitigated

With proper Content Security Policy (CSP) headers and input validation, impact is limited to script execution within the vulnerable component's context.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

XSS vulnerabilities typically have low exploitation complexity, but specific exploit details are not publicly documented.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.0.7, 1.1.7, or 1.2.4

Vendor Advisory: https://www.drupal.org/sa-contrib-2025-119

Restart Required: No

Instructions:

1. Backup your Drupal site. 2. Update the AI module via Drupal's update manager or Composer. 3. Clear Drupal caches. 4. Verify the update was successful.

🔧 Temporary Workarounds

Implement Content Security Policy

all

Add CSP headers to restrict script execution sources

Add to .htaccess: Header set Content-Security-Policy "default-src 'self'; script-src 'self'"
Or configure in web server settings

Disable AI Module

linux

Temporarily disable the vulnerable module until patched

drush pm-disable ai
Or disable via Drupal admin interface

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to block XSS payloads
  • Enable Drupal's built-in XSS protection features and input validation

🔍 How to Verify

Check if Vulnerable:

Check Drupal's module status page or use: drush pm-list --status=enabled --fields=name,version | grep ai

Check Version:

drush pm-list --status=enabled --fields=name,version | grep ai

Verify Fix Applied:

Verify module version shows 1.0.7, 1.1.7, or 1.2.4 or higher

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests with script tags to AI module endpoints
  • Multiple failed XSS attempts in web server logs

Network Indicators:

  • HTTP requests containing <script> tags to AI module paths
  • Unexpected redirects from AI module pages

SIEM Query:

web_requests WHERE url CONTAINS '/ai/' AND (body CONTAINS '<script>' OR body CONTAINS 'javascript:')

🔗 References

📤 Share & Export