Crypto needs defensive deep-copy constructor
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 294
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Description
According to https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto:
"Although the Window.crypto property iteself is read-only, all of its methods (and the methods of its child object, SubtleCrypto) are not read-only, and therefore vulnerable to attack by polyfill."
If the Crypto class had a copying constructor that also replaced the SubtleCrypto with a defensive deep copy, it would be possible to prevent this attack by using a defensive copy of the Crypto object that was made before any untrusted polyfills were loaded.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Crypto class and its SubtleCrypto child object, then review how their methods and properties can be modified after construction. Determine the required defensive-copy semantics and how a copy made before polyfills are loaded should behave. Done means the proposed constructor and its tests demonstrate that later changes to the original objects cannot affect the defensive copy.
Written by the indexing model from the issue text.
Assessment
- Domain
- security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100