-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prototype pollution prevention for wallet scripts #14460
Conversation
84b6a49
to
91f2d62
Compare
@@ -6,6 +6,8 @@ source_set("renderer") { | |||
"js_solana_provider.h", | |||
"resource_helper.cc", | |||
"resource_helper.h", | |||
"safe_builtins.cc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this should be a generic helper outside of wallet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it has to be generic and it needs to include everything. Right now, we only protect the one we used in wallet scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, it needs to include the things we are using, but those can be added for other Brave scripts that use it. What I want to avoid is duplicating this in other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 9cdc09281c12f97e6e37ac031c4c8572586a2169
result = CreatePublicKey(context, public_key); | ||
v8_public_key = CreatePublicKey(context, public_key); | ||
v8::Local<v8::Object> object = v8::Object::New(isolate); | ||
CHECK(CreateDataProperty(context, object, u"publicKey", v8_public_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a const for publicKey
somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 4d3458125b59d884a72a96565a2c43311c31eba1
91f2d62
to
9cdc092
Compare
9cdc092
to
3845582
Compare
50f5bc0
to
980c1c1
Compare
94f0f91
to
9b1cdb5
Compare
Resolves brave/brave-browser#24415
Resolves https://github.com/brave/security/issues/940
extensions::SafeBuiltins
like class for Brave wallet and only save what we need. (Most of the codes are copied from upstream)Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
'5STiJLNtCLiNaeD6vwrEfvikNi9NbfVpEbxU7KrUv4uo'