Skip to content

Change: make malicious zip file checks a synchronous PublishCheck#1721

Merged
netomi merged 3 commits intomasterfrom
fail-early-for-malicious-zips
Mar 27, 2026
Merged

Change: make malicious zip file checks a synchronous PublishCheck#1721
netomi merged 3 commits intomasterfrom
fail-early-for-malicious-zips

Conversation

@netomi
Copy link
Copy Markdown
Contributor

@netomi netomi commented Mar 26, 2026

This fixes #1718 .

Currently, malicious zip checks where done asynchronously during publishing, meaning that if a new extension is rejected because of that, the user does not have immediate feedback.

Now if scanning is enabled, the check will be done synchronously and reject the publication and inform the publisher instead of creating an extension version and not activating it.

Furthermore, if scanning is not enabled, the behavior stays the same as before, meaning the malicious zip check is done asynchronously, but the potentially_malicious flag will be correctly set now.

…scanning is enabled and ensure that the flag potentially_malicious is correctly persisted otherwise
@netomi netomi requested a review from autumnfound March 26, 2026 13:10
Copy link
Copy Markdown
Contributor

@autumnfound autumnfound left a comment

Choose a reason for hiding this comment

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

suggestion (non-blocking): It might be worth adding a few basic unit tests in for the newly moved zip check. I think the scanService being disabled is a fairly niche edge case for the handler, though having a test there wouldn't hurt either.

@netomi
Copy link
Copy Markdown
Contributor Author

netomi commented Mar 27, 2026

Having a test for the PublishExtensionVersionHandler in case no scanning service is enabled would be worthwhile but for now is just an overkill. It did not exist so far and will not be actively used anymore. Imho, the malicious check should be removed at some point in time from this code path and be made fully configurable when scanning service is enabled. So when no scanning is enabled, all extensions pass through, useful for testing or development instances not advised for anything serious though.

I created #1723 to support some extra fields as right now we just reject publication if any extra field is encountered, which is a bit strict.

@netomi netomi merged commit 5d641f4 into master Mar 27, 2026
8 checks passed
@netomi netomi deleted the fail-early-for-malicious-zips branch March 27, 2026 13:58
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.

Extension versions published successfully but stuck as inactive (silimate.preqorsor)

2 participants