Skip to content

Commit

Permalink
Fix parse __xssfinder_put
Browse files Browse the repository at this point in the history
  • Loading branch information
ac0d3r committed May 15, 2022
1 parent 1fa95f5 commit eec6dbf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/chrome/xss/dom/hookparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,17 @@ func convExpr(node js.IExpr) js.IExpr {
},
}
case js.EqToken: // =
if _, ok := n.X.(*js.DotExpr); ok {
if obj, ok := n.X.(*js.DotExpr); ok {
return &js.CallExpr{
X: &js.Var{Data: []byte("__xssfinder_put")},
Args: js.Args{
List: []js.Arg{{Value: n.X}, {Value: convExpr(n.Y)}},
List: []js.Arg{
{Value: obj.X},
{Value: &js.LiteralExpr{
TokenType: js.StringToken,
Data: []byte(fmt.Sprintf(`"%s"`, obj.Y.JS())),
}},
{Value: convExpr(n.Y)}},
},
}
} else {
Expand Down

0 comments on commit eec6dbf

Please sign in to comment.