freeze doesn't work on Array methods (shift, pop, etc)
Open
Nobody has claimed this yet.
confirmed
question
wontfix
- Dominant language
- JavaScript
- Stars
- 4.1k
- Forks
- 328
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 4
Description
running node v18.15.0
if i have this code:
import {VM} from 'vm2'
const vm = new VM({
allowAsync: false,
wasm: false
})
let result = [1,2,3]
vm.freeze(result, 'data')
I expect that this will fail:
vm.run(`
data.pop()
`)
However, the array is changed and if I run it multiple times, I get 3, 2 then 1 as a result.
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
Run the supplied Node.js reproduction and trace the VM.freeze and vm.run entry points for the exposed array. Inspect how Array.pop is handled, then verify that a frozen array remains unchanged across repeated runs; no file or test location is given in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100