mozilla-releng / balrog

Mozilla's Update Server
http://mozilla-balrog.readthedocs.io/en/latest/index.html
Mozilla Public License 2.0
99 stars 149 forks source link

balrog shouldn't serve update xml that is invalid #3119

Open bhearsum opened 3 months ago

bhearsum commented 3 months ago

In https://bugzilla.mozilla.org/show_bug.cgi?id=1893487 we had an issue that resulted in us serving update xml such as:

<?xml version="1.0"?>
<updates>
    <update type="minor" displayVersion="125.0a1" appVersion="125.0a1" platformVersion="125.0a1" buildID="20240301094944">
    </update>
</updates>

This is not valid, because it doesn't contain any patch entries, and Firefox was unable to parse it. (There are probably other ways the xml can be invalid as well, this is just one example.)

In cases like this we should probably throw a 500, and ensure that an Exception ends up in Sentry for visibility.

@bytesized - cc'ing you for visibility, and also in case you are aware of any existing schemas or validation code we have for these responses.

bytesized commented 3 months ago

If you want to look, the parsing code lives here. I'm also happy to weigh in if there are any questions.