TheHive-Project / TheHive-Project/Cortex-Analyzers

[Bug][EmlParser] Problem running the analyzer if an attachment contains the character "?"

Open
#1,028 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
490
Forks
405
Avg merge
2d 43m
Merged PRs (30d)
8

Description

Describe the bug
If the EML message contains an attachement with file name contains "?" character, EmlParser not working

To Reproduce
Steps to reproduce the behavior:

  1. Send an e-mail with attachement filename contains ?
    Or
  2. Edit EML filename for modify this values
Content-Type: application/msword; name="2 - test?.doc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="2 - test?.doc"

Error message :
Report creation failure: [Invalid format for artifact.attachment: FileInputValue(1 - ??????.pdf,/tmp/cortex-job-34c8fXsB4PrCcvtTyvV3-3558916277537544/output/tmp2wd7gamn,application/octet-stream), expected attachment]

image

Work environment

  • Client OS: Windows 10
  • Server OS: CentOS 7
  • Browse type and version:
  • Cortex version: 3.1.1-1
  • Cortex Analyzer/Responder name: EmlParser
  • Cortex Analyzer/Responder version: 2.0

Thanks,

Regards,

Nicolas

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the EmlParser analyzer and reproduce the failure with the sample EML attachment whose filename contains "?". Trace attachment parsing and report creation; done means the attachment is accepted and the analyzer completes successfully with the filename preserved or safely handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.