CVE-2024-23734
Executive Summary
CVE-2024-23734 is a Cross-Site Request Forgery (CSRF) vulnerability in the Savignano S/Notify plugin for Bitbucket, affecting versions prior to 2.0.1. The flaw resides in the upload functionality of the User Profile pages, allowing an attacker to craft a malicious link that, when clicked by an authenticated administrator, silently replaces the victim's S/MIME certificate or PGP keys with attacker-controlled ones. This enables the attacker to decrypt, sign, or impersonate communications secured by S/Notify. The vulnerability has a CVSS score of 0.0 (placeholder) but is assessed as High severity due to the potential for complete compromise of email encryption integrity. No public exploit code or proof-of-concept is currently available, but the attack vector is straightforward and requires only user interaction.
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 is not in a package manager (NPM, PyPI, Go, Ruby) but is a plugin for Atlassian Bitbucket, distributed via the Atlassian Marketplace. The supply chain risk is moderate: organizations using S/Notify must manually update the plugin. There is no evidence of malicious code injection in the distribution channel.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is launched remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – The attacker does not need authentication.
- User Interaction (UI): Required (R) – The victim must click a crafted link.
- Scope (S): Unchanged (U) – The vulnerable component remains the same.
- Confidentiality (C): High (H) – Attacker can decrypt encrypted emails.
- Integrity (I): High (H) – Attacker can sign emails as the victim.
- Availability (A): None (N) – No impact on availability.
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Base Score: 8.1 (High)
Threat Level: High. The attack is easy to execute, requires only a single click from an authenticated user, and can lead to full compromise of email encryption.
Deep Dive & Mechanics
The S/Notify plugin for Bitbucket allows users to upload S/MIME certificates and PGP keys for email encryption. The upload functionality in the User Profile pages lacks CSRF protection. An attacker can craft a malicious HTML page or email containing a form that automatically submits a POST request to the vulnerable endpoint (e.g., /plugins/servlet/snotify/upload). When an authenticated Bitbucket administrator visits the attacker's page, the browser sends the request with the victim's session cookie, causing the server to process the upload.
The attacker can upload a certificate or PGP key they control. Once replaced, all future emails encrypted with the victim's public key can be decrypted by the attacker, and the attacker can sign emails as the victim. The attack does not require any additional privileges beyond the victim's session.
Vulnerable vs. Patched Code
Vulnerable Code (S/Notify < 2.0.1): The upload servlet does not validate the origin of the request. It relies solely on session authentication.
// Vulnerable: No CSRF token check
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
User user = getUserFromSession(req);
if (user == null) { resp.sendError(401); return; }
// Process file upload directly
Certificate cert = parseCertificate(req.getPart("file"));
storeCertificate(user, cert);
}
Patched Code (S/Notify >= 2.0.1): The patched version introduces a CSRF token that must be included in the request.
// Patched: CSRF token validation
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
User user = getUserFromSession(req);
if (user == null) { resp.sendError(401); return; }
String token = req.getParameter("csrf_token");
if (!validateToken(user, token)) { resp.sendError(403); return; }
Certificate cert = parseCertificate(req.getPart("file"));
storeCertificate(user, cert);
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- A Bitbucket instance with S/Notify < 2.0.1 installed.
- An authenticated administrator session (victim).
- An attacker-controlled certificate or PGP key.
Exploitation Steps:
- Create a malicious HTML page that auto-submits a form to the S/Notify upload endpoint.
- Host the page on an attacker-controlled server.
- Send the link to the victim (e.g., via email or social engineering).
- When the victim visits the page, their browser sends the POST request with their session cookie.
- The attacker's certificate replaces the victim's certificate.
Example Malicious HTML:
<html>
<body>
<form action="https://victim-bitbucket/plugins/servlet/snotify/upload" method="POST" enctype="multipart/form-data">
<input type="file" name="file" value="attacker_cert.pem">
<input type="submit" value="Submit">
</form>
<script>document.forms[0].submit();</script>
</body>
</html>
Note: No public exploit code is available. The above is a conceptual demonstration.
Blue Team
Detection:
- Monitor for unexpected POST requests to
/plugins/servlet/snotify/uploadfrom external referrers. - Alert on certificate uploads that occur without a corresponding CSRF token in the request.
- Review audit logs for certificate changes by users who did not initiate the action.
Hunting:
- Search for HTTP requests with
Refererheader not matching the Bitbucket domain. - Look for multiple certificate uploads in a short time window.
Indicators of Compromise (IOCs)
- Network:
- POST requests to
/plugins/servlet/snotify/uploadwithRefererheader from an external domain. - Unusual file uploads (certificate or PGP key) from non-admin IPs.
- POST requests to
- Host:
- Modified user certificate files in the S/Notify data directory (e.g.,
/var/atlassian/application-data/bitbucket/shared/snotify/certs/). - Audit log entries showing certificate replacement without user interaction.
- Modified user certificate files in the S/Notify data directory (e.g.,
- User Behavior:
- Users reporting inability to decrypt emails after clicking a suspicious link.
Detection Engineering
YARA Rule
rule CVE_2024_23734_CSRF_Upload {
meta:
description = "Detects CSRF-based certificate upload attempts for CVE-2024-23734"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-23734"
strings:
$s1 = "/plugins/servlet/snotify/upload" ascii wide nocase
$s2 = "multipart/form-data" ascii wide nocase
$s3 = "file" ascii wide nocase
condition:
all of them
}
Sigma Rule
title: CVE-2024-23734 S/Notify CSRF Certificate Upload
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects CSRF-based certificate upload attempts targeting S/Notify
author: Valters IT
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/plugins/servlet/snotify/upload'
cs-referer:
- 'http://*'
- 'https://*'
cs-referer|re: '^(?!https?:\/\/victim-bitbucket\.com).*$'
condition: selection
falsepositives:
- Legitimate certificate uploads from internal tools
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-23734 S/Notify CSRF Certificate Upload Attempt";
flow:to_server,established;
content:"POST";
http_method;
content:"/plugins/servlet/snotify/upload";
http_uri;
content:"multipart/form-data";
http_client_body;
pcre:"/Referer\x3a\x20(?!https?:\/\/victim-bitbucket\.com)/Hi";
sid:1000001;
rev:1;
reference:cve,2024-23734;
)
Remediation & Mitigation
Immediate:
- Upgrade S/Notify to version 2.0.1 or later.
- If upgrade is not possible, disable the certificate upload feature temporarily.
- Implement a Web Application Firewall (WAF) rule to block POST requests to
/plugins/servlet/snotify/uploadwith external Referer headers.
Long-term:
- Enforce CSRF tokens on all state-changing operations.
- Conduct a security review of all plugin endpoints.
- Educate administrators about phishing attacks targeting CSRF.
Workaround:
- Use a reverse proxy to add a custom header (e.g.,
X-Requested-With: XMLHttpRequest) and validate it on the server side.
Valters IT
Securing Digital Frontiers