docs(bytecode): document trusted input boundary#746
Conversation
buke
commented
May 22, 2026
- warn that QuickJS bytecode must only be loaded from trusted sources
- annotate EvalBytecode and LoadModuleBytecode with the same trust requirement
- mirror the guidance in both the English and Chinese README bytecode sections
- warn that QuickJS bytecode must only be loaded from trusted sources - annotate EvalBytecode and LoadModuleBytecode with the same trust requirement - mirror the guidance in both the English and Chinese README bytecode sections
There was a problem hiding this comment.
Code Review
This pull request adds security warnings to the README and relevant function docstrings in context.go, cautioning against loading QuickJS bytecode from untrusted sources due to memory corruption risks. Review feedback suggests further refining these docstrings to correct typos, remove inaccurate parameter descriptions, and ensure the security warnings are explicit and consistent across the codebase.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #746 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 17 17
Lines 3705 3705
=========================================
Hits 3705 3705
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
- fix the LoadModuleBytecode docstring name and parameter wording - make the memory corruption risk explicit for bytecode-loading APIs - tighten the EvalBytecode ownership note to match the returned value
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds security warnings to the English and Chinese README files and the context.go source file regarding the loading of QuickJS bytecode. The documentation now emphasizes that bytecode should only be loaded from trusted sources to prevent potential memory corruption. A review comment suggests further improving the documentation for LoadModuleBytecode by explicitly stating that the caller is responsible for calling Free() on the returned Value, ensuring consistency with the updated EvalBytecode method.