mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
Added a CodeQL workflow to check for bugs through code analysis. Fixed numerous bugs and implemented safeguards as already reported.
This commit is contained in:
parent
892a3716ed
commit
1abc46058c
32 changed files with 87 additions and 61 deletions
|
@ -111,7 +111,7 @@ class PHPDeserialize extends Operation {
|
|||
} else {
|
||||
const numberCheck = lastItem.match(/[0-9]+/);
|
||||
if (args[0] && numberCheck && numberCheck[0].length === lastItem.length) {
|
||||
result.push("\"" + lastItem + "\": " + item);
|
||||
result.push('"' + lastItem + '": ' + item);
|
||||
} else {
|
||||
result.push(lastItem + ": " + item);
|
||||
}
|
||||
|
@ -149,11 +149,11 @@ class PHPDeserialize extends Operation {
|
|||
const length = readUntil(":");
|
||||
expect("\"");
|
||||
const value = read(length);
|
||||
expect("\";");
|
||||
expect('";');
|
||||
if (args[0]) {
|
||||
return "\"" + value.replace(/"/g, "\\\"") + "\"";
|
||||
return '"' + value.replace(/"/g, '\\"') + '"'; // lgtm [js/incomplete-sanitization]
|
||||
} else {
|
||||
return "\"" + value + "\"";
|
||||
return '"' + value + '"';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue