Commit d022b21
fix: prototype pollution and shallow freeze in
Adversarial testing for v0.5.14 release found 2 bugs:
1. **Prototype pollution:** `FOLLOWUPS["__proto__"]` traversed
`Object.prototype` instead of returning `[]`. Fixed with
`Object.hasOwn()` guard.
2. **Shallow freeze:** `Object.freeze()` on the array didn't freeze
nested suggestion objects, allowing shared state mutation across
callers. Fixed with deep copy via `Object.freeze({ ...s })`.
Includes 52 adversarial tests covering injection attacks, boundary
values, immutability, concurrency, and data integrity for
`SkillFollowups`, `Locale.duration`, and `Dispatcher.reset`.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>SkillFollowups.get() (#558)1 parent dbff413 commit d022b21
File tree
2 files changed
+417
-1
lines changed- packages/opencode
- src/skill
- test/skill
2 files changed
+417
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
158 | 161 | | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
0 commit comments