Skip to content

Sanitize partner Message-ID used as inbound payload filename fallback - #564

Merged
uhurusurfa merged 2 commits into
OpenAS2:masterfrom
JakeHuneau:fix/inbound-filename-sanitization
Jul 25, 2026
Merged

Sanitize partner Message-ID used as inbound payload filename fallback#564
uhurusurfa merged 2 commits into
OpenAS2:masterfrom
JakeHuneau:fix/inbound-filename-sanitization

Conversation

@JakeHuneau

Copy link
Copy Markdown
Contributor

When a received message has no content-disposition filename and no configured filename fallback property, the payload filename fell back to the raw Message-ID header, which is partner-controlled. Unlike the content-disposition path (which runs through IOUtil.getSafeFilename), this fallback was unsanitized, allowing a crafted Message-ID to influence the stored file path (path traversal).

Run the fallback through IOUtil.getSafeFilename, and use a safe generated name if the Message-ID cannot be made safe. The sanitization primitive is already covered by FilenameSafetyTest.

When a received message has no content-disposition filename and no configured
filename fallback property, the payload filename fell back to the raw Message-ID
header, which is partner-controlled. Unlike the content-disposition path (which
runs through IOUtil.getSafeFilename), this fallback was unsanitized, allowing a
crafted Message-ID to influence the stored file path (path traversal).

Run the fallback through IOUtil.getSafeFilename, and use a safe generated name if
the Message-ID cannot be made safe. The sanitization primitive is already covered
by FilenameSafetyTest.
@uhurusurfa

Copy link
Copy Markdown
Contributor

Remove the as2_certs.p12 from your PR's as it is just wasting time with conflict resolution. It is not necessary to commit the new one generated by the build script every time.

@JakeHuneau

Copy link
Copy Markdown
Contributor Author

Remove the as2_certs.p12 from your PR's as it is just wasting time with conflict resolution. It is not necessary to commit the new one generated by the build script every time.

Done

@uhurusurfa uhurusurfa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@uhurusurfa
uhurusurfa merged commit ccbb949 into OpenAS2:master Jul 25, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants