Incorrect processing of blank lines in diffs can be used to hide changes from reviewers
Originally disclosed on Mozilla
- Fixed in 3 months
- Paid in 2 months
- Disclosed after 3 months
Created attachment 8696932
test-1.0.xpi
AMO reviewers largely rely on the diff functionality when reviewing updates - rather than reviewing the entire extension code again they will look only at the changes. This approach relies on the diffs being displayed correctly. However, AMOs diff view doesn't treat blank lines correctly, with the result that one can hide a malicious update completely.
Steps to reproduce:
1. Upload attached test-1.0.xpi to AMO and get it reviewed.
2. Upload attached test-2.0.xpi as an update.
3. Open editor tools, click on "Malicious diff test" in the updates queue.
4. Click "Compare" to compare version 2.0 to 1.0 and switch to bootstrap.js.
Expected results:
The changes should be displayed correctly: twenty blank lines removed at the beginning of the file, function malicious() added towards the end of it.
Actual results:
The diff confusingly marks the lines immediately following the removed lines as removed as well. Instead of showing that function malicious() was added the diff marks a few lines as new which already existed in the previous version. Worse yet, the diff is cut off and doesn't show the last twenty lines of the file - including function malicious(). Any malicious code added is completely invisible to the reviewers.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A high-severity security bug in Administration. Mozilla made it public on 24 February 2016.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.