Project

General

Profile

Actions

Bug #7950

closed

mime: incorrect decoding of quoted-printable text attachments

Added by Marko Jahnke 2 months ago. Updated 16 days ago.

Status:
Closed
Priority:
Normal
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

If I am correct, there might be a decoding problem with decoding quoted-printable encoded email text attachments in Suricata.

In addition, if there is an empty line at the end of the last attachment (before the ".") it is also appended to the decoded file. AFAIK, that should not be the case.

I believe I found a test case where suricata 7.0.12 and 8.0.1 and the GMime library (as a reference) all produce different text file output and checksums which might induce an IoC matching problem.

  • "testcase.smtp" is the SMTP stream from the PCAP extracted from wireshark follow TCP stream.
  • "Attachment2-gmime" is the output that is generated by the GMime library.
  • "Attachment2-suri7" and "Attachment-suri8" are the respective outputs of the above versions when activating filestore.
$ diff Attachment2-gmime Attachment2-suri7 
119c119
< ===================================================================
---
> ==3D================================================================
246,247c246
< +static gboolean related_url_string_cb(field_info *finfo, gboolean doit, 
< const gchar**  ret_url)
---
> +static gboolean related_url_string_cb(field_info *finfo, gboolean doit, const gchar**  ret_url)
451c450
< ===================================================================
---
> ==========================================3D========================
1037a1037
>
$ diff Attachment2-gmime Attachment2-suri8 
119c119
< ===================================================================
---
> ==3D================================================================
246,247c246
< +static gboolean related_url_string_cb(field_info *finfo, gboolean doit, 
< const gchar**  ret_url)
---
> +static gboolean related_url_string_cb(field_info *finfo, gboolean doit, const gchar**  ret_url)
451c450
< ===================================================================
---
> ==========================================D========================
1037a1037
> 

Hopefully I did not make a mistake. But if I am correct, there might be unwanted IoC differences.

Best regards,
MaJa


Files

testcase.smtp (42.6 KB) testcase.smtp Marko Jahnke, 09/24/2025 01:47 PM
testcase.pcap (131 KB) testcase.pcap Marko Jahnke, 09/24/2025 01:47 PM
Attachment2-gmime (33.4 KB) Attachment2-gmime Marko Jahnke, 09/24/2025 01:56 PM
Attachment2-suri7 (33.4 KB) Attachment2-suri7 Marko Jahnke, 09/24/2025 01:56 PM
Attachment2-suri8 (33.4 KB) Attachment2-suri8 Marko Jahnke, 09/24/2025 01:56 PM
Bildschirmfoto_2025-10-03_15-56-16.png (135 KB) Bildschirmfoto_2025-10-03_15-56-16.png Screenshot of testcase.smtp in Thunderbird/Trixie Albrecht Dreß, 10/03/2025 02:04 PM
Bildschirmfoto_2025-10-06_10-27-12.png (53 KB) Bildschirmfoto_2025-10-06_10-27-12.png Decodes Wireshark output Albrecht Dreß, 10/06/2025 08:33 AM
Bildschirmfoto_2025-10-06_10-24-33.png (87.2 KB) Bildschirmfoto_2025-10-06_10-24-33.png Wireshark HEX dump Albrecht Dreß, 10/06/2025 08:33 AM

Subtasks 2 (0 open2 closed)

Bug #7961: mime: incorrect decoding of quoted-printable text attachments (8.0.x backport)ClosedPhilippe AntoineActions
Bug #7962: mime: incorrect decoding of quoted-printable text attachments (7.0.x backport)ClosedPhilippe AntoineActions
Actions

Also available in: Atom PDF