Automated addon approval should verify library hashes

Hi there,

I’ve recently uploaded an update to my addon and it got auto-approved by the addon validation.

Unfortunately it was removed from AMO just a few hours later because one of the included libraries didn’t match any known hash values (my IDE replaced all Unix newlines LF with Windows newlines CR+LF…).

It would be really helpful if the automated addon validation would display a warning about mismatching/unknown hashes.

From a security perspective it might even be considered to block such addons from automated approval.

Thank you!

It does in a way. The libraries that match are ignored so you wont see any error messages relating to them.

If the validator lists an error for a JQuery (for example) it means it hasn’t recognised its hash.

I have brought that issue up myself. Policy may change in future.

I’m a little bit concerned here.

All right, if we include a library with <script src="jquery.js"></script>, the validator can check the library hash of the jquery.js file to see if it’s an authorized version.

But what if, like i do for my extension, the libraries are included with a tool like webpack (or browserify) to create a unique bundle file containing all the libraries. Checking whether each individual included library matches the allowed hashes gets more complex, if possible at all.

I presume it has to be done from the source code that is to be provided along with the add-on binary.

If a policy/process is to be defined/updated regarding this, it should take into account this bundling method as it is getting more and more popular for web developments.

They would fail the validation and get rejected on post review.

It is not feasible to unpack 100s of thousands lines of minified code and check line by line and that is the reason compiled libraries have always been rejected.

I often see JS files that are 3+mb. Besides the poor performance, they are not feasible for review. They also often include a massive amount of useless code, that are added by the framework.

Thats interesting. The only jQuery related warnings in the validator are as follows:

If I understand you correctly those warnings should be supressed if the validator recognizes the file as a known library?

Looking through my other validator feedback I think I’ve found what you mean:

That’s good to know!
Thanks a lot :slight_smile:

Exactly :slight_smile:

Here are the list of recognised Libraries:

Note: Some older versions of libraries are no longer recognised and have been removed due to being outdated.

1 Like

I would recommend not bundling libs with webpack whenever possible. This means just loading the lib like normal and using externals to then make them available as modules in your webpack bundle.

1 Like