Shopify / Shopify/react-native-skia
Replace `NativeBufferFactory` with a more secure implementation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.6k
- Forks
- 647
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 35
Description
Description
Skia.NativeBuffer is badly designed.
The MakeFromImage function sadly returns pointers as BigInts.
The Release function accepts a BigInt argument, which is expected to be the pointer for which the memory should be freed. It should've encapsulated the pointers and restricted this with a check to ensure the value can't be tampered with from JavaScript side.
Ideally, the JavaScript side does not get an arbitrary way to free any hardware pointers beyond the ones it's explicitly been granted.
Contributor guide
No contributing guide indexed for this repository
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 with packages/skia/cpp/api/JsiNativeBuffer.h, especially MakeFromImage and Release, to understand how native pointers cross the JavaScript boundary. Define the replacement around encapsulated, non-tamperable handles; done means JavaScript can release only hardware pointers explicitly granted to it, rather than arbitrary pointer values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, javascript, react-native
- Domain
- mobile-dev, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100