New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 694067 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug-Security
M-X



Sign in to add a comment

Security: Out-Of-Bound read in Flash PCRE (regex engine)

Reported by sweetv...@gmail.com, Feb 19 2017

Issue description

VULNERABILITY DETAILS
There is a OOB read bug in the PCRE engine used in Flash player. This bug exists in match function while parsing the data that contains unicode.

src/pcre2_intmodedep.h
#define BACKCHAR(eptr) if ((*eptr & 0xfc00u) == 0xdc00u) eptr--

src/pcre2_match.c:3311
        for(;;)
          {
          RMATCH(eptr, ecode, offset_top, mb, eptrb, RM21);
          if (rrc != MATCH_NOMATCH) RRETURN(rrc);
          if (eptr-- == pp) break;        /* Stop if tried at original pos */
#ifdef SUPPORT_UNICODE
          if (utf) BACKCHAR(eptr);
#endif
          }

The bugs occurs BACKCHAR macro when 'eptr' points specific letter(e.g. 'Ώ' or 'ŀ' and so on).
In this case, 'eptr--' code will execute 'twice'. (First code : if (eptr-- == pp), Second code : BACKCHAR(eptr);).
And eptr's value will be lower than pp. So, It will loop until found the match data(potential info leak) or crash. 

To fix this problem, we need to modify break condition.

src/pcre2_match.c:3158
if (eptr-- == pp) break;  to  if (eptr-- <= pp) break; 

src/pcre2_match.c:3315
if (eptr-- == pp) break;  to  if (eptr-- <= pp) break; 

VERSION
Chrome Version: 56.0.2924.87 stable
Operating System: Windows 10
Flash Version : 24.0.0.221
PCRE2 Version : 10.23

REPRODUCTION CASE
To reproduce crash in chrome
	1. I attached the testcase to reproduce bug. Please download the Main.swf (or compile Main.as using mxmlc) and index.html.
	2. Execute index.html
	
To download pcre2 engine
 - You can download the source code at  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ 

 
Main.as
253 bytes View Download
Main.swf
589 bytes Download
repro.PNG
4.5 KB View Download
test.html
26 bytes View Download

Comment 1 by raymes@chromium.org, Feb 20 2017

Components: Internals>Plugins>Flash
Labels: Security_Severity-Medium Security_Impact-Stable OS-Windows Pri-1
Owner: ihf@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the report! I can verify that the crash happens on Windows. Could you please provide a stack trace?

ihf: are you able to forward this to the flash folks? Thanks!

Comment 2 by ihf@chromium.org, Feb 21 2017

Cc: lafo...@chromium.org adobe-flash@chromium.org smori...@adobe.com

Comment 3 by sweetv...@gmail.com, Feb 21 2017

Hello! I attached two logs.

- callstack.txt : crash log (Include call stack).

- pcre2grep_asan_log.txt : ASAN output of pcre2grep. (This log will help you. pcre2grep is one of the tools of pcre2 project)

Thank you.
callstack.txt
848 bytes View Download
pcre2grep_asan_log.txt
2.7 KB View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Feb 21 2017

Labels: M-57
Project Member

Comment 5 by sheriffbot@chromium.org, Mar 7 2017

ihf: Uh oh! This issue still open and hasn't been updated in the last 14 days. This is a serious vulnerability, and we want to ensure that there's progress. Could you please leave an update with the current status and any potential blockers?

If you're not the right owner for this issue, could you please remove yourself as soon as possible or help us find the right one?

If the issue is fixed or you can't reproduce it, please close the bug. If you've started working on a fix, please set the status to Started.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 6 by smori...@adobe.com, Mar 7 2017

Status: Fixed (was: Assigned)
This is fixed in 25.0.0.127.
Project Member

Comment 7 by sheriffbot@chromium.org, Mar 8 2017

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: reward-topanel
Labels: -reward-topanel reward-unpaid reward-2000
Congratulations! The panel decided to award $2,000 for this bug. Cheers!
Labels: -reward-unpaid reward-inprocess
Project Member

Comment 12 by sheriffbot@chromium.org, Mar 17 2017

Labels: Merge-Request-58
Project Member

Comment 13 by sheriffbot@chromium.org, Mar 18 2017

Labels: -Merge-Request-58 Hotlist-Merge-Approved Merge-Approved-58
Your change meets the bar and is auto-approved for M58. Please go ahead and merge the CL to branch 3029 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), bhthompson@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Approved-58
No merge's necessary.
Labels: -Hotlist-Merge-Approved -M-57 M-X
Project Member

Comment 16 by sheriffbot@chromium.org, Jun 14 2017

Labels: -Restrict-View-SecurityNotify allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment