Closed Bug 1859400 Opened 2 years ago Closed 4 months ago

HEVC file causes DoS of HEVC playback

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

RESOLVED FIXED
151 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox119 --- disabled
firefox120 --- disabled
firefox121 --- disabled
firefox151 --- fixed

People

(Reporter: tsmith, Assigned: alwu)

References

(Blocks 1 open bug)

Details

(Keywords: csectype-dos, testcase, Whiteboard: [fuzzblocker])

Attachments

(5 files)

Attached video testcase.mp4

Found with m-c 20231016-f64b858317d1 (--enable-debug --enable-fuzzing)

Attempting to play the test case hangs attempting to load(?). From this point on it is not possible to play HEVC files without relaunching the browser.

Flags: in-testsuite?
Assignee: nobody → alwu
Blocks: hevc

This test file seems crashing the whole GPU process, I am still not sure if it should be a security issue. But for safe, making this bug as a sec bug for now.

Group: media-core-security

This is nightly-only and surely it will be fixed before we ship. if we had to rate it we'd call it sec-low if anything, but we don't need to hide it.

Group: media-core-security

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)
Flags: needinfo?(jmathies)

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)
Severity: -- → S3
Flags: needinfo?(jmathies)
Priority: -- → P2

This bug prevents fuzzing from making progress; however, it has low severity. It is important for fuzz blocker bugs to be addressed in a timely manner (see here why?).
:alwu, could you consider increasing the severity?

For more information, please visit BugBot documentation.

Flags: needinfo?(alwu)
Flags: needinfo?(alwu)

Still happening in 131b4

Is anyone still be able to reproduce this issue? I couldn’t reproduce it on the latest central build. Below are the testing steps I followed, and the browser did not hang or crash.

python3 -m fuzzfetch --central --asan --fuzzing -n firefox
python3 -m grizzly.replay ./firefox/firefox testcase.mp4
Flags: needinfo?(twsmith)
Flags: needinfo?(mirh)

I didn't test the nightly.. but it's not like the whole browser hanged or crashed. Only whatever subsequent attempt of decoding a video got stuck.
Can the fuzzer even access the HEVC MFT plugin?

Flags: needinfo?(mirh)

(In reply to mirh from comment #8)

Can the fuzzer even access the HEVC MFT plugin?

This is a mutation fuzzer and the browser is running the output, so yes.

(In reply to Alastor Wu [:alwu] from comment #7)

Is anyone still be able to reproduce this issue?

Yes, I am able to reproduce the issue. I tested with m-c 20241001-0546d4eb6429. (Windows 11 with HW HEVC support)

and the browser did not hang or crash.

The process of loading the content (?) hung, instead of failing. This means every attempt will need to wait to timeout which greatly reduces the iteration rate.

Flags: needinfo?(twsmith)

(In reply to Alastor Wu [:alwu] from comment #7)

Is anyone still be able to reproduce this issue?

Yes, I am able to reproduce the issue. I tested with m-c 20241001-0546d4eb6429. (Windows 11 with HW HEVC support)

The process of loading the content (?) hung, instead of failing. This means every attempt will need to wait to timeout which greatly reduces the iteration rate.

Hmm the latest Nightly is also from 10/01, but when I opened the file, the process (tab) didn't either hang or become non-responsive. As you mention timeout, is fuzzy-test waiting for specific event? In addition, would you mind to follow this instruction to capture a media profile for me when the issue happens? Thank you.

Flags: needinfo?(twsmith)

(In reply to Alastor Wu [:alwu] from comment #10)

Hmm the latest Nightly is also from 10/01, but when I opened the file, the process (tab) didn't either hang or become non-responsive. As you mention timeout, is fuzzy-test waiting for specific event?

It should not have anything to do with the fuzzing framework since the test is completely standalone. FWIW this is basically a corrupted mp4 file.

In addition, would you mind to follow this instruction to capture a media profile for me when the issue happens? Thank you.

https://share.firefox.dev/3XKMq6F

I opened the tab dragged the testcase.mp4 file and waited a few seconds then closed the tab. During that time the tab window is black and the loading indicator on the tab is active.

Flags: needinfo?(twsmith)

(In reply to Tyson Smith [:tsmith] from comment #11)

It should not have anything to do with the fuzzing framework since the test is completely standalone. FWIW this is basically a corrupted mp4 file.

Oh, sorry I'm not clear enough. What I mean is, what is the test doing exactly? Just play a media file to see if any load or error event? How is a test considered finished?

In addition, would you mind to follow this instruction to capture a media profile for me when the issue happens? Thank you.

https://profiler.firefox.com/from-browser/calltree/?globalTrackOrder=0w9&hiddenGlobalTracks=2w7&hiddenLocalTracksByPid=6668-0w8awc~26064-0w37wa~26220-01~16936-0w2~13068-0w4~28336-0w4~28040-0w4~3068-0w4~19224-013w57wc~2384-0w356&thread=a&v=10

This doesn't seem a valid url, did you upload it?

Flags: needinfo?(twsmith)

Fixed.

Also the browser hangs on shutdown:

  • open browser
  • drag and drop testcase.mp4
  • close browser
Flags: needinfo?(twsmith)

From the investigation so far, I think this is a driver/graphic card issue. From the profile you uploaded, we can see the CPU usage was very high in the media supervisor thread in the GPU process. The operations were all stuck in the stack of HEVCDECODER_STORE.dll, which didn't happen on my two Windows laptops [1]

[1]
Windows 10 : https://share.firefox.dev/4ePGa4y
Windows 11 : https://share.firefox.dev/4gLY7md


Tyson, would you mind help me do following things?

  • Could you provide about:support for the device on which the issue can be reproduced?
  • Do you have other devices running fuzzing? Does this issue happen on other devices as well?
  • Did you install this HEVC extension on your device?

Thanks!

Flags: needinfo?(twsmith)
Attached file about-support.txt
Flags: needinfo?(twsmith)

(In reply to Alastor Wu [:alwu] from comment #14)

  • Could you provide about:support for the device on which the issue can be reproduced?

Attached.

  • Do you have other devices running fuzzing? Does this issue happen on other devices as well?

Yes.

No, but I do have HEVC Video Extensions from Device Manufacturer that I did not explicitly install.

Priority: P2 → P3

This bug causes issues on aliexpress as reported with bug 1956680

Blocks: 1956680

I've dived into it further and it seems to be caused by a more recent version of the windows HEVC decoder you have currently installed:
I had both "HEVC Video Extensions from Device Manufacturer" (v2.4.39.0) and "HEVC Video Extension" (v2.4.37.0) installed simultaneously. The memory issue was present in Firefox.

Then I first uninstalled the later "non-device manufacturer" variant and the memory issue was still there.
Then I also removed the "device manufacturer" variant and hevc no longer worked at all (duh).

I then grabbed a much older "HEVC Video Extensions from Device Manufacturer" (v2.0.51931.0) off archive.org and installed it via powershell after unpacking:
Add-AppxPackage "Microsoft.HEVCVideoExtension_2.0.61931.0_neutral_~_8wekyb3d8bbwe.appxBundle"

With this version, there was no memory or playback issue of hevc within firefox.
However, after checking the windows store for updates, it decided to update this older version to the previous v2.4.39.0 version.

Thanks. I’ve replied regarding the memory leak issue in bug 1956680, and it would be better to keep all memory leak–related discussion consolidated there. Since this bug appears to be addressing a different issue, I think we can continue tracking it separately.

No longer blocks: 1956680
See Also: → 1956680

When converting HVCC extradata to AnnexB format for prepending to
keyframes, skip non-parameter-set NALUs (e.g. SEI). A corrupted file
with a large PREFIX_SEI_NUT in the hvcC box caused the Windows HEVC
hardware decoder to hang indefinitely.

Attachment #9552727 - Attachment description: Bug 1859400 - Only include VPS/SPS/PPS NALUs in HEVC AnnexB extradata. r?alwu → Bug 1859400 - Skip SEI NALUs in HEVC AnnexB extradata on Windows. r?alwu
Attachment #9552727 - Attachment description: Bug 1859400 - Skip SEI NALUs in HEVC AnnexB extradata on Windows. r?alwu → Bug 1859400 - Filter user_data_unregistered SEI from HEVC AnnexB extradata on Windows. r?alwu

Just leave my about:config for future investigation, my setup can't reproduce the issue.

Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
QA Whiteboard: [qa-triage-done-c152/b151]
See Also: → 2034797
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: