Skip to main content
Vulnerability Database/CVE-2024-45592

CVE-2024-45592: Damienharper Auditor-bundle XSS Vulnerability

CVE-2024-45592 is a cross-site scripting flaw in Damienharper Auditor-bundle that allows Javascript injection through unescaped entity properties. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-45592 Overview

CVE-2024-45592 is a stored cross-site scripting (XSS) vulnerability in auditor-bundle (formerly DoctrineAuditBundle), a Symfony integration for the auditor library. The flaw exists in versions prior to 5.2.6, where the %source_label% placeholder in a Twig macro is rendered without HTML escaping. An attacker who can influence an audited entity property can inject arbitrary HTML or JavaScript. The injected payload executes when a user views the audit history in the browser. The maintainer released fixes in versions 5.2.6 and 6.0.0.

Critical Impact

Attackers can inject JavaScript into audit log views, enabling session theft, UI defacement, and actions performed on behalf of authenticated administrators viewing the audit trail.

Affected Products

  • damienharper/auditor-bundle versions prior to 5.2.6
  • damienharper/auditor-bundle 6.x prior to 6.0.0
  • Symfony 3.4+ applications integrating the vulnerable auditor-bundle versions

Discovery Timeline

  • 2024-09-10 - CVE-2024-45592 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-45592

Vulnerability Analysis

The vulnerability is a stored XSS classified under [CWE-79]. The auditor-bundle records changes to Doctrine entities and renders them through a Twig template that displays source and target labels for each audit entry. The template calls |raw on the final translated string while interpolating entity-controlled values such as %source_label%, %source%, and %target_label% without first escaping them.

Any HTML or <script> content stored in an audited entity property propagates into the rendered audit view. When an administrator or auditor loads the history page, the browser parses and executes the injected markup in the context of the application origin.

Root Cause

The root cause is unsafe string interpolation inside src/Resources/views/Audit/helpers/helper.html.twig. The macro passes entity values directly into the trans() filter arguments and then applies |raw to the result. Because the arguments were not individually escaped, attacker-controlled characters bypassed Twig's auto-escaping behavior.

Attack Vector

Exploitation requires an attacker to write a payload into an audited entity field through a normal application workflow, such as a profile name or comment. The payload is persisted by Doctrine and later rendered to any user viewing the audit history. User interaction is required because a victim must open the affected audit view.

twig
// Patch diff from src/Resources/views/Audit/helpers/helper.html.twig
     {{ ('audit.audit_details.summary.' ~ action)|trans({
         '%source_link%': path('dh_auditor_show_entity_history', { 'entity': helper.namespaceToParam(entity), 'id': entry.getObjectId() }),
-        '%source%': source_subject,
-        '%source_label%': source_label,
-        '%target_link%': target_link,
-        '%target%': target_subject,
-        '%target_label%': target_label,
-        '%user%': entry.getUsername() is null ? 'audit.audit_details.summary.unkown_user'|trans(domain='auditor') : entry.getUsername(),
+        '%source%': source_subject|escape,
+        '%source_label%': source_label|escape,
+        '%target_link%': target_link|escape,
+        '%target%': target_subject|escape,
+        '%target_label%': target_label|escape,
+        '%user%': entry.getUsername() is null ? 'audit.audit_details.summary.unkown_user'|trans(domain='auditor') : entry.getUsername()|escape,
         '%ip%': entry.getIp() is not empty ? ', IP: ' ~ entry.getIp() : '',
     }, domain='auditor')|raw }}
 {% endmacro %}

Source: GitHub Commit e7deb37. The fix applies the Twig |escape filter to every entity-derived value before interpolation.

Detection Methods for CVE-2024-45592

Indicators of Compromise

  • Audit log entries containing <script>, onerror=, onload=, or javascript: substrings within entity label fields.
  • Browser console errors or unexpected network requests originating from the audit history view.
  • Session or CSRF token access patterns from the audit log URL path that do not match normal administrator behavior.

Detection Strategies

  • Query the auditor-bundle database tables for stored HTML markup in label and subject columns.
  • Scan application dependency manifests (composer.lock) for damienharper/auditor-bundle versions below 5.2.6 or 6.0.0.
  • Review web server logs for POST requests that submit HTML-encoded tags into fields tied to audited entities.

Monitoring Recommendations

  • Alert on Content Security Policy (CSP) violation reports originating from audit history routes.
  • Monitor administrator sessions for anomalous outbound requests shortly after viewing audit log pages.
  • Track Composer dependency drift so vulnerable auditor-bundle versions are flagged during CI builds.

How to Mitigate CVE-2024-45592

Immediate Actions Required

  • Upgrade damienharper/auditor-bundle to version 5.2.6 or 6.0.0 using composer update damienharper/auditor-bundle.
  • Audit stored data in auditor tables for existing XSS payloads and sanitize or purge affected rows.
  • Rotate administrator session tokens if audit views were accessed while a vulnerable version was deployed.

Patch Information

The maintainer resolved the issue in commits 42ba294 and e7deb37 by applying the Twig |escape filter to every entity-derived placeholder in helper.html.twig. Full details are documented in GitHub Security Advisory GHSA-78vg-7v27-hj67.

Workarounds

  • Override the vulnerable Twig macro in your application and apply the |escape filter to all entity-controlled placeholders.
  • Deploy a strict Content Security Policy that disallows inline scripts on routes rendering audit history.
  • Restrict access to audit history pages to a minimal set of trusted administrators until patching completes.
bash
# Upgrade to a patched release
composer require damienharper/auditor-bundle:^5.2.6
# Or for the 6.x branch
composer require damienharper/auditor-bundle:^6.0.0

# Verify installed version
composer show damienharper/auditor-bundle | grep versions

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.