Exploit database

GH-3e4dfa0a50966563edf7f4e3dfced02f

naved124/cve-2024-28397-js2py-sandbox-escape

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-28397

15 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files7
naved124/cve-2024-28397-js2py-sandbox-escapeRevision 6d06d3df90b0

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

fix.py

Python · 464 bytes

def monkey_patch():
    """Patching js2py for a vulunability
    Test it before using it! I don't guarentee that it won't break your program!
    """
    from js2py.constructors.jsobject import Object
    fn = Object.own["getOwnPropertyNames"]["value"].code
    def wraps(*args, **kwargs):
        result = fn(*args, **kwargs)
        return list(result)
    Object.own["getOwnPropertyNames"]["value"].code = wraps


if __name__ == "__main__":
    monkey_patch()