You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running the Magic function on certain inputs, the function will hold indefinitely and use up compute resources, then at times errors out. This occurs in both the node package, and on the Github hosted browser version as well on Chrome.
Expected behaviour
The function gives an output or errors out rather than holding.
Desktop:
OS: Mac OS Catalina
Browser: Node Package and Chrome
CyberChef version: 9.28.0
Additional context
I've found the source of the problem to be one of the regex test functions found in cyberchef/src/core/lib/Magic.mjs ln:45, specifically in this case the From Hexdump operation pattern check /^(?:(?:[\dA-F]{4,16}h?:?)?[ \t]*((?:[\dA-F]{2} ){1,8}(?:[ \t]|[\dA-F]{2}-)(?:[\dA-F]{2} ){1,8}|(?:[\dA-F]{4} )*[\dA-F]{4}|(?:[\dA-F]{2} )*[\dA-F]{2})[^\n]*\n?){2,}$/i.
If you are to run this regex directly on this input you get the same issue as this seems to be the source of the issue.
Describe the bug
When running the Magic function on certain inputs, the function will hold indefinitely and use up compute resources, then at times errors out. This occurs in both the node package, and on the Github hosted browser version as well on Chrome.
To Reproduce
chef.magic
function with this input:Expected behaviour
The function gives an output or errors out rather than holding.
Desktop:
Additional context
I've found the source of the problem to be one of the regex test functions found in cyberchef/src/core/lib/Magic.mjs ln:45, specifically in this case the
From Hexdump
operation pattern check/^(?:(?:[\dA-F]{4,16}h?:?)?[ \t]*((?:[\dA-F]{2} ){1,8}(?:[ \t]|[\dA-F]{2}-)(?:[\dA-F]{2} ){1,8}|(?:[\dA-F]{4} )*[\dA-F]{4}|(?:[\dA-F]{2} )*[\dA-F]{2})[^\n]*\n?){2,}$/i
.If you are to run this regex directly on this input you get the same issue as this seems to be the source of the issue.
A potential solution could be changing this regex to be more efficient.
The text was updated successfully, but these errors were encountered: