Skip to content
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

Harden custom endowments #1172

Merged
merged 15 commits into from
Feb 17, 2023
Merged

Harden custom endowments #1172

merged 15 commits into from
Feb 17, 2023

Conversation

david0xd
Copy link
Contributor

@david0xd david0xd commented Feb 1, 2023

Fixes: #1017

This PR will add implementation for hardening of the custom endowments: ethereum and snap.
Final result should ensure that these endowments cannot be changed within their prototype chain.
Hardening is done by using harden function provided by SES.

There are minor adaptations to the Proxy implementations of these endowments in order to prevent these objects leaking their prototype chain up to the StreamProvider and further. This is required because the harden function will reach the parts of the StreamProvider and further, then freeze it. Deep freeze of the Stream functionalities would prevent it from working properly. This way, the hardening is done and the prototype chain is safe.

@david0xd david0xd force-pushed the dd/harden-custom-endowments branch from b777257 to 642e3dc Compare February 2, 2023 12:01
@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2023

Codecov Report

Merging #1172 (25afade) into main (a9abb8b) will increase coverage by 0.02%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main    #1172      +/-   ##
==========================================
+ Coverage   94.09%   94.12%   +0.02%     
==========================================
  Files         140      140              
  Lines        5773     5800      +27     
  Branches      859      863       +4     
==========================================
+ Hits         5432     5459      +27     
  Misses        341      341              
Impacted Files Coverage Δ
...cution-environments/src/common/BaseSnapExecutor.ts 91.24% <100.00%> (-0.23%) ⬇️
...s/snaps-execution-environments/src/common/utils.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

CEWWN
CEWWN previously approved these changes Feb 4, 2023
@david0xd david0xd force-pushed the dd/harden-custom-endowments branch from f129d26 to aebaf77 Compare February 7, 2023 11:51
@david0xd david0xd marked this pull request as ready for review February 7, 2023 15:54
@david0xd david0xd requested a review from a team as a code owner February 7, 2023 15:54
Copy link

@naugtur naugtur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, I'll give it another pass.

@david0xd david0xd force-pushed the dd/harden-custom-endowments branch from bdfae53 to 669dea7 Compare February 9, 2023 16:40
@david0xd david0xd force-pushed the dd/harden-custom-endowments branch from 8566414 to 25afade Compare February 13, 2023 14:55
@david0xd david0xd force-pushed the dd/harden-custom-endowments branch from 55cc116 to 6b54ee3 Compare February 17, 2023 11:03
naugtur
naugtur previously approved these changes Feb 17, 2023
Copy link

@naugtur naugtur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks done

@david0xd david0xd merged commit dbbfa63 into main Feb 17, 2023
@david0xd david0xd deleted the dd/harden-custom-endowments branch February 17, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additionally harden custom endowments
6 participants