mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibJS: Prevent stack overflow if Proxy handler's __proto__ is the Proxy
Fixes #9322.
This commit is contained in:
parent
9998a2c91e
commit
941ff0cf60
Notes:
sideshowbarker
2024-07-18 04:39:55 +09:00
Author: https://github.com/linusg
Commit: 941ff0cf60
Pull-request: https://github.com/SerenityOS/serenity/pull/9842
Reviewed-by: https://github.com/IdanHo ✅
2 changed files with 27 additions and 0 deletions
|
@ -107,3 +107,12 @@ describe("[[Get]] invariants", () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
test("Proxy handler that has the Proxy itself as its prototype", () => {
|
||||
const handler = {};
|
||||
const proxy = new Proxy({}, handler);
|
||||
handler.__proto__ = proxy;
|
||||
expect(() => {
|
||||
proxy.foo;
|
||||
}).toThrowWithMessage(Error, "Call stack size limit exceeded");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue