Closed Bug 1130225 Opened 9 years ago Closed 9 years ago

Malformed input will cause invalid memory access in h264dec / function Write2File

Categories

(Core :: Audio/Video: GMP, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: hanno, Unassigned)

References

Details

(Keywords: crash, sec-high)

Attachments

(2 files)

Attached file crash1.264
Attached file will cause invalid memory reads when passed to h264dec. The valgrind trace indicated that this seems to happen in the h264dec tool itself, not in the codec, so it's likely of low severity. Still it should be fixed.

Found with american fuzzy lop.
Keywords: crash
Flags: needinfo?(huili2)
Hi Hanno, I checked with master and v1.3-Firefox3.6, finding no such issues.
Could you please give more detail about this crash issue?
Flags: needinfo?(huili2)
(In reply to wayne from comment #2)
> Hi Hanno, I checked with master and v1.3-Firefox3.6, finding no such issues.
> Could you please give more detail about this crash issue?

Sorry, I wrongly used the command parameter. If with output file, the error exists. I'll check and fix it.
Hi Hanno, the crash has been fixed by pull request #1812 on master.
Could you please check it? Thanks!
I can confirm latest git head is fixed.

And just for completion: Looking at the patch it seems to me my initial assumption that this is a bug in the commandlinetool h264dec was wrong. Instead it's a missing error handling in the library code that later crashes in the command line tool. Correct?
Thanks.
Originally some kinds of bitstream error are considered as WARNING instead of ERROR to improve robustness, for continuous decoding. 
For this case, we tried to make decoder go on decoding the erroneous bitstream, but now it seems WARNING is not enough as it does not throw proper information out of the decoder.
Depends on: 1133784
wayne,  can you make an assessment about the security rating for this bug?
Flags: sec-bounty?
Flags: needinfo?(huili2)
I'm not sure how many rating levels here for the security issues, but I give some descriptions to this:

1. it will happen only the specific syntax of SPS is hacked. So the frequency is low.
2. Even it is met, there's no memory leak issue happening inside codec, just some return information is wrongly given. It may cause above-layer applications unpredictable, or even crash (as in this example).
Flags: needinfo?(huili2)
(In reply to wayne from comment #8)
> I'm not sure how many rating levels here for the security issues, but I give
> some descriptions to this:
> 
> 1. it will happen only the specific syntax of SPS is hacked. So the
> frequency is low.
> 2. Even it is met, there's no memory leak issue happening inside codec, just
> some return information is wrongly given. It may cause above-layer
> applications unpredictable, or even crash (as in this example).

Do you have any belief that this can cause a crash or other true security issue in OpenH264 as used by Firefox?  (i.e. not h264dec)
Flags: needinfo?(huili2)
I cannot see how the callback function is used in Firefox, but from gmp-openh264, there's no safety check for the wrongly given data. 

I think it should be considered as a security bug.
Flags: needinfo?(huili2)
Randell: please take a stab at rating the severity of this as a security affecting Firefox (or affecting it in the future if we would have shipped affected version of the plugin).
Flags: needinfo?(rjesup)
Flags: needinfo?(rjesup)
Keywords: sec-high
Is this issue fixed or still active? We're still shipping 1.3.
Flags: sec-bounty? → sec-bounty+
It is fixed in 1.4.  We are in the process of getting that out - it is bug 1133784
Group: media-core-security
This should now be fixed by the rollout of OpenH264 v1.4 - bug 1133784.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Group: media-core-security
Group: core-security → core-security-release
Group: core-security-release
Component: OpenH264 → Audio/Video: GMP
Product: External Software Affecting Firefox → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: