CVE-2024-21678 Overview
CVE-2024-21678 is a Stored Cross-Site Scripting (XSS) vulnerability affecting Atlassian Confluence Data Center and Confluence Server. This vulnerability was introduced in version 2.7.0 and allows an authenticated attacker to inject and execute arbitrary HTML or JavaScript code in a victim's browser session. The stored nature of this XSS vulnerability means that malicious payloads persist within the Confluence application, executing whenever other users access the compromised content.
The vulnerability enables attackers with authenticated access to Confluence to store malicious scripts that execute in the context of other users' browser sessions. This can lead to session hijacking, credential theft, and unauthorized actions performed on behalf of legitimate users.
Critical Impact
Authenticated attackers can execute arbitrary JavaScript in victim browsers, enabling session hijacking, credential theft, and unauthorized access to sensitive Confluence content with high confidentiality impact.
Affected Products
- Atlassian Confluence Data Center versions 2.7.0 through 8.7.1
- Atlassian Confluence Server versions 2.7.0 through 8.5.4 LTS
- Multiple version branches including 7.17.x, 7.18.x, 7.19.x LTS, 7.20.x, 8.0.x through 8.7.x
Discovery Timeline
- 2024-02-20 - CVE-2024-21678 published to NVD
- 2025-05-06 - Last updated in NVD database
Technical Details for CVE-2024-21678
Vulnerability Analysis
This Stored XSS vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation) allows an authenticated attacker to inject malicious script content that persists within Confluence and executes whenever other users view the affected content. The attack can be launched remotely over the network and requires only low-privilege authenticated access to execute.
The vulnerability has high impact on confidentiality as attackers can steal session tokens, cookies, and sensitive data displayed within Confluence pages. There is also low impact on integrity, as attackers could potentially modify content or perform actions as the victim user. The attack requires no user interaction beyond normal browsing of Confluence content, making it particularly dangerous in collaborative environments.
This vulnerability was discovered through Atlassian's Bug Bounty program, demonstrating the value of coordinated security research in identifying such flaws before malicious exploitation.
Root Cause
The root cause of CVE-2024-21678 is insufficient input validation and output encoding within the Confluence application. When user-supplied content is stored and later rendered, the application fails to properly sanitize or escape potentially dangerous HTML and JavaScript constructs. This allows specially crafted input containing script elements to be stored in the database and executed when the content is subsequently displayed to other users.
The lack of proper Content Security Policy (CSP) enforcement or inadequate XSS filtering mechanisms enables the malicious payload to execute in the context of the victim's authenticated session.
Attack Vector
The attack vector for this vulnerability involves an authenticated attacker submitting malicious content through Confluence's various input mechanisms such as page creation, comments, macros, or other user-generated content features. Once the malicious script is stored within the Confluence database, it executes automatically whenever another user views the affected page or content.
The attacker does not need elevated privileges—only standard authenticated access to create or modify content. When a victim user with any privilege level (including administrators) views the compromised content, the injected JavaScript executes within their browser session, potentially allowing the attacker to:
- Steal session cookies and authentication tokens
- Perform actions on behalf of the victim user
- Access sensitive information visible to the victim
- Redirect users to malicious external sites
- Modify page content or create additional malicious pages
Since no user interaction is required beyond viewing the page, and the payload persists until removed, this vulnerability can affect a large number of users across an organization.
Detection Methods for CVE-2024-21678
Indicators of Compromise
- Unusual JavaScript or HTML content within Confluence pages, comments, or macros that includes <script> tags, event handlers (onclick, onerror, onload), or JavaScript URIs
- Unexpected external resource requests originating from Confluence pages to unknown domains
- Session anomalies such as multiple concurrent sessions or sessions from unexpected geographic locations
- User reports of unexpected behavior when viewing specific Confluence pages
- Audit log entries showing bulk content modifications by single users
Detection Strategies
- Implement web application firewall (WAF) rules to detect and block common XSS payload patterns in requests to Confluence
- Enable and review Confluence audit logs for suspicious content creation or modification activities
- Deploy browser-based security solutions that can detect and block malicious script execution
- Conduct regular automated scanning of Confluence content for embedded scripts or suspicious HTML constructs
- Monitor network traffic for unusual outbound connections originating from Confluence user sessions
Monitoring Recommendations
- Configure alerts for Confluence audit events related to page creation and modification, particularly those containing script-like content
- Implement Content Security Policy (CSP) headers and monitor for CSP violation reports
- Deploy endpoint detection and response (EDR) solutions to detect browser-based attacks targeting authenticated sessions
- Establish baseline metrics for Confluence usage patterns and alert on anomalous activity
How to Mitigate CVE-2024-21678
Immediate Actions Required
- Upgrade Confluence Data Center to version 8.8.0 (recommended) or applicable fixed version for your branch
- Upgrade Confluence Server to version 8.5.5 LTS or 8.5.6 LTS (recommended)
- For organizations running older LTS versions, upgrade to 7.19.18 LTS or 7.19.19 LTS
- Review Confluence audit logs for any suspicious content modifications prior to patching
- Consider temporarily restricting content creation permissions to trusted users until patches are applied
Patch Information
Atlassian has released patches addressing CVE-2024-21678 across multiple version branches. The recommended upgrade path depends on your current deployment:
Confluence Data Center:
- Version 8.8.0 is the recommended target for all deployments
- Fixed versions include 8.7.2, 8.5.5 LTS, 8.5.6 LTS, 7.19.18 LTS, and 7.19.19 LTS
Confluence Server:
- Version 8.5.6 LTS is the recommended target
- Fixed versions include 8.5.5 LTS, 7.19.18 LTS, and 7.19.19 LTS
Detailed version-specific guidance is available in the Atlassian Security Advisory and the JIRA issue CONFSERVER-94513. The latest Confluence releases can be obtained from the Atlassian Download Center.
Workarounds
- Implement strict Content Security Policy (CSP) headers to restrict inline script execution, though this may impact Confluence functionality
- Temporarily restrict page creation and editing permissions to trusted administrators only
- Deploy a web application firewall (WAF) with XSS detection rules in front of Confluence instances
- Enable browser-based XSS protection mechanisms and ensure users have updated browsers
- Consider placing Confluence behind additional authentication layers to limit exposure
# Example: Restrict Confluence access via Apache reverse proxy
# Add to Apache configuration to implement basic WAF-like protection
<Location "/confluence">
# Block common XSS patterns in query strings
RewriteEngine On
RewriteCond %{QUERY_STRING} (<script|javascript:|onerror=|onload=) [NC]
RewriteRule .* - [F,L]
# Add security headers
Header always set X-XSS-Protection "1; mode=block"
Header always set X-Content-Type-Options "nosniff"
Header always set Content-Security-Policy "script-src 'self'; object-src 'none'"
</Location>
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


