Bug 864417 (CVE-2012-4504) - CVE-2012-4504 libproxy: long proxy.pac file handling buffer overflow
Summary: CVE-2012-4504 libproxy: long proxy.pac file handling buffer overflow
Keywords:
Status: CLOSED NOTABUG
Alias: CVE-2012-4504
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 866991
Blocks: 864423
TreeView+ depends on / blocked
 
Reported: 2012-10-09 11:53 UTC by Tomas Hoger
Modified: 2019-09-29 12:56 UTC (History)
2 users (show)

Fixed In Version: libproxy 0.4.9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-10 10:59:25 UTC


Attachments (Terms of Use)
Upstream patch (536 bytes, patch)
2012-10-09 11:55 UTC, Tomas Hoger
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Novell 784523 None None None 2018-12-31 20:16:25 UTC

Description Tomas Hoger 2012-10-09 11:53:33 UTC
A buffer overflow flaw was discovered in the libproxy's url::get_pac() used to download proxy.pac proxy auto-configuration file.  A malicious host hosting proxy.pac, or a man in the middle attacker, could use this flaw to trigger a stack-based buffer overflow in an application using libproxy, if proxy configuration instructed it to download proxy.pac file from a remote HTTP server.

url::get_pac() uses a fixed size buffer buffer[] to store content of the proxy.pac file downloaded from a remote server.  When filling the buffer, it uses server-supplied content length value, rather than size buffer, as a limit for the size of the input copied into the buffer.  Overflow occurs when server provides sufficiently large file and does not use chunked content encoding.  The buffer size is checked when using chunked encoding.

http://code.google.com/p/libproxy/source/browse/trunk/libproxy/url.cpp?r=846#462

This issue was introduced upstream with the addition of the chunked encoding support, which first appears in version 0.4.

http://code.google.com/p/libproxy/source/detail?r=489
http://code.google.com/p/libproxy/issues/detail?id=77

Comment 1 Tomas Hoger 2012-10-09 11:55:57 UTC
Created attachment 624045 [details]
Upstream patch

Patch from Nicolas Dufresne, moving the content length value check to appear on a non-chunked encoding code path.

Comment 3 Tomas Hoger 2012-10-09 12:00:35 UTC
Statement:

Not vulnerable. This issue did not affect the version of libproxy as shipped with Red Hat Enterprise Linux 6.

Comment 4 Tomas Hoger 2012-10-09 18:51:07 UTC
Acknowledgment:

This issue was discovered by Tomas Mraz of Red Hat.

Comment 6 Tomas Hoger 2012-10-11 20:02:53 UTC
Fixed now in upstream version 0.4.9.  Upstream commit, identical to the patch in comment #1:

https://code.google.com/p/libproxy/source/detail?r=853

Comment 7 Tomas Hoger 2012-10-12 08:43:10 UTC
Upstream announcement of 0.4.9, also mentioning CVE-2012-4505 (bug 864612):

https://groups.google.com/forum/?fromgroups=#!topic/libproxy/VxZ8No7mT0E

Comment 8 Tomas Hoger 2012-10-16 13:45:20 UTC
Upstream 0.4.10 is now released too, which also fixes an infinite loop flaw that can be triggered by a server serving proxy.pac file.

https://groups.google.com/forum/?fromgroups=#!topic/libproxy/DsXENAx6LT8

Relevant change:

https://code.google.com/p/libproxy/source/detail?r=859

which fixes previous incorrect fix for the issue included in 0.4.9:

https://code.google.com/p/libproxy/source/detail?r=854

Comment 9 Tomas Hoger 2012-10-16 13:46:35 UTC
Created libproxy tracking bugs for this issue

Affects: fedora-all [bug 866991]

Comment 10 Fedora Update System 2012-11-19 02:19:29 UTC
libproxy-0.4.10-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.