Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2024-05-31 - [Prevent Prototype Pollution in Lua Labels]
**Vulnerability:** The Lua labels dictionary was initialized using an object literal (`{}`), which could allow an attacker to bypass checks or pollute prototypes if user-supplied string keys (such as `"__proto__"`) are used.
**Learning:** Using `{}` for dictionaries with user-controlled keys exposes the object to prototype modification through the `__proto__` property, even if `hasOwnProperty` is used for existence checks.
**Prevention:** Always initialize dictionaries meant to store user-supplied string keys with `Object.create ? Object.create(null) : {}` to prevent prototype pollution and fallback gracefully.
2 changes: 1 addition & 1 deletion luaparse.js
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,7 @@

FullFlowContext.prototype.pushScope = function (isLoop) {
var scope = {
labels: {},
labels: Object.create ? Object.create(null) : {},
locals: [],
deferredGotos: [],
isLoop: !!isLoop
Expand Down