As a starting point I had Claude Opus 4.5 via https://claude.ai/ run pip install micro-javascript and try a bunch of things, it found all sorts of issues: https://claude.ai/share/322d3593-7fd0-44bf-838f-fc6b72db442c
That feedback formatted as a TODO list:
As a starting point I had Claude Opus 4.5 via https://claude.ai/ run
pip install micro-javascriptand try a bunch of things, it found all sorts of issues: https://claude.ai/share/322d3593-7fd0-44bf-838f-fc6b72db442cThat feedback formatted as a TODO list:
__globals__access which allows__builtins__.__import__('os').system(). Create aSafeCallablewrapper that blocks attribute access.__globals__access.String.repeat()to check size before allocation - Currently'x'.repeat(100000000)creates 100MB string ignoringmemory_limit. Add pre-allocation check:if len(s) * count > max_string_length: raise MemoryLimitError.VM._add()to check string concatenation size - The+operator for strings has no size limit. Add check beforereturn str_a + str_b.String.split('')to check result array size - Splitting into characters creates array oflen(s)elements with no limit check.Array(n)constructor to check length - No limit on array size creation._check_limits()to measure actual memory, not just stack depth - Currently only countslen(stack) * 100, so a 100MB string counts as 100 bytes.max_string_lengthparameter to Context - Allow users to configure maximum string size (default 10MB).max_array_lengthparameter to Context - Allow users to configure maximum array length (default 1M elements).String.match()to use internal regex engine - Currently uses Python'sremodule which bypasses the safe regex VM.String.replace()to use internal regex engine - Currently uses Python'sremodule directly.String.search()to use internal regex engine - Currently uses Python'sremodule directly.String.split(regex)to use internal regex engine - Currently uses Python'sremodule directly.max_recursion_depthparameter.(((((...causes PythonRecursionError. (Noted in open-problems.md)Object.prototype.x = 1currently succeeds and affects all objects.max_json_depthparameter - Limit JSON.parse nesting depth to prevent stack overflow.max_object_keysparameter - Limit number of keys in objects.