New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 2 users
Status: Fixed
Owner:
Email to this user bounced
Closed: Nov 2014
Cc:



Sign in to add a comment
Adobe Flash incorrect jit optimization with op_pushscope
Project Member Reported by ianbeer@google.com, Sep 23 2014 Back to list
See previous similar bugs for more details.

op_pushscope is marked as not throwing in opcodes.tbl an exception, yet looking at the verifier:

opcode.tbl:

//              opCount  throw  stack  internal  name                   hex      
ABC_OP(         0,       0,     -1,    0,        pushscope)             // 0x30  


Verifier.cpp:

            case OP_pushscope:
            {
                checkStack(1,0);
                if (state->scopeDepth + 1 > ms->max_scope())
                    verifyFailed(kScopeStackOverflowError);

                Traits* scopeTraits = state->peek().traits;
                const ScopeTypeChain* scope = info->declaringScope();
                if (scope->fullsize > (scope->size+state->scopeDepth))
                {
                    // extra constraints on type of pushscope allowed
                    Traits* requiredType = scope->getScopeTraitsAt(scope->size+state->scopeDepth);
                    if (!scopeTraits || !scopeTraits->subtypeof(requiredType))
                    {
                        verifyFailed(kIllegalOperandTypeError, core->toErrorString(scopeTraits), core->toErrorString(requiredType));
                    }
                }

                emitCheckNull(sp);  <-- this will emit code which will throw a catchable exception
                coder->writeOp1(state, pc, opcode, ms->scope_base() + state->scopeDepth);
                state->pop();
                state->setType(ms->scope_base() + state->scopeDepth, scopeTraits, true, false);
                state->scopeDepth++;
                break;
            }

Invoking pushscope with a NULL atom argument will throw an exception at runtime and invoke a control-flow path not seen by the verifier which can be abused to achieve code execution.

Attached PoC for avmshell.
 
jit_pushscope.abc
590 bytes Download
Project Member Comment 1 by ianbeer@google.com, Sep 23 2014
Labels: ReportedOn-2014-September-23
Project Member Comment 2 by ianbeer@google.com, Sep 23 2014
Labels: -ReportedOn-2014-September-23 ReportedOn-2014-Sep-23
Project Member Comment 3 by ianbeer@google.com, Sep 24 2014
Labels: Id-3050
Comment 4 by cevans@google.com, Nov 8 2014
Labels: CVE-2014-0585
Comment 5 by cevans@google.com, Nov 20 2014
Labels: -Restrict-View-Commit Fixed-2014-Nov-11
Status: Fixed
http://helpx.adobe.com/security/products/flash-player/apsb14-24.html
Sign in to add a comment