From 0c6454e10cea224f48d263bd4c22fb2d83db714d Mon Sep 17 00:00:00 2001 From: William Floyd Date: Fri, 6 Mar 2026 06:04:41 -0600 Subject: [PATCH 001/208] fix: `jq-web` -> `jq-wasm`, includes `jq` version `1.8.1` (#2223) Co-authored-by: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> (added tests) --- package-lock.json | 12 ++++++------ package.json | 2 +- src/core/operations/Jq.mjs | 21 ++++++++++----------- tests/browser/02_ops.js | 9 +++++++++ 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 61db7931..ab3f3bbf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,7 @@ "highlight.js": "^11.11.1", "ieee754": "^1.2.1", "jimp": "^1.6.0", - "jq-web": "^0.6.2", + "jq-wasm": "^1.1.0-jq-1.8.1", "jquery": "3.7.1", "js-sha3": "^0.9.3", "jsesc": "^3.1.0", @@ -12060,11 +12060,11 @@ "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", "license": "BSD-3-Clause" }, - "node_modules/jq-web": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/jq-web/-/jq-web-0.6.2.tgz", - "integrity": "sha512-+7XvjBYwTx4vP5PYkf6Q6orubO/v+UgMU6By1GritrmShr9QpT3UKa4ANzXWQfhdqtBnQYXsm7ZNbdIHT6tYpQ==", - "license": "ISC" + "node_modules/jq-wasm": { + "version": "1.1.0-jq-1.8.1", + "resolved": "https://registry.npmjs.org/jq-wasm/-/jq-wasm-1.1.0-jq-1.8.1.tgz", + "integrity": "sha512-lWfu34lpDFIygOYcL5TzxhZIApDR9iR5XywcVoyUAZ6jlQrj8HKHOKeCcHgUm2dE9RVdbP3eqNAKGLuj+k4seQ==", + "license": "MIT" }, "node_modules/jquery": { "version": "3.7.1", diff --git a/package.json b/package.json index 1e87c230..1602b1b6 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "highlight.js": "^11.11.1", "ieee754": "^1.2.1", "jimp": "^1.6.0", - "jq-web": "^0.6.2", + "jq-wasm": "^1.1.0-jq-1.8.1", "jquery": "3.7.1", "js-sha3": "^0.9.3", "jsesc": "^3.1.0", diff --git a/src/core/operations/Jq.mjs b/src/core/operations/Jq.mjs index c1e02b34..4584d1a9 100644 --- a/src/core/operations/Jq.mjs +++ b/src/core/operations/Jq.mjs @@ -6,7 +6,7 @@ import Operation from "../Operation.mjs"; import OperationError from "../errors/OperationError.mjs"; -import jq from "jq-web"; +import * as jq from "jq-wasm"; /** * jq operation @@ -40,16 +40,15 @@ class Jq extends Operation { * @returns {string} */ run(input, args) { - const [query] = args; - let result; - - try { - result = jq.json(input, query); - } catch (err) { - throw new OperationError(`Invalid jq expression: ${err.message}`); - } - - return JSON.stringify(result); + return (async () => { + const [query] = args; + try { + const result = await jq.json(input, query); + return JSON.stringify(result); + } catch (err) { + throw new OperationError(`Invalid jq expression: ${err.message}`); + } + })(); } } diff --git a/tests/browser/02_ops.js b/tests/browser/02_ops.js index d0b89c3e..dde84f68 100644 --- a/tests/browser/02_ops.js +++ b/tests/browser/02_ops.js @@ -50,6 +50,14 @@ module.exports = { testOp(browser, "Analyse hash", "0123456789abcdef", /CRC-64/); testOp(browser, "Atbash Cipher", "test input", "gvhg rmkfg"); // testOp(browser, "Avro to JSON", "test input", "test_output"); + testOp(browser, + [ + "From Hex", "Avro to JSON" + ], + "4f626a0104166176726f2e736368656d6196017b2274797065223a227265636f7264222c226e616d65223a22736d616c6c222c226669656c6473223a5b7b226e616d65223a226e616d65222c2274797065223a22737472696e67227d5d7d146176726f2e636f646563086e756c6c004e0247632e3702e5b75cdab9a62f1541020e0c6d796e616d654e0247632e3702e5b75cdab9a62f1541", + '{"name":"myname"}\n', + [[], [false]] + ); testOp(browser, "BLAKE2b", "test input", "33ebdc8f38177f3f3f334eeb117a84e11f061bbca4db6b8923e5cec85103f59f415551a5d5a933fdb6305dc7bf84671c2540b463dbfa08ee1895cfaa5bd780b5", ["512", "Hex", { "option": "UTF8", "string": "pass" }]); testOp(browser, "BLAKE2s", "test input", "defe73d61dfa6e5807e4f9643e159a09ccda6be3c26dcd65f8a9bb38bfc973a7", ["256", "Hex", { "option": "UTF8", "string": "pass" }]); testOp(browser, "BSON deserialise", "\u0011\u0000\u0000\u0000\u0002a\u0000\u0005\u0000\u0000\u0000test\u0000\u0000", '{\u000A "a": "test"\u000A}'); @@ -206,6 +214,7 @@ module.exports = { testOpHtml(browser, "Index of Coincidence", "test input", "", /Index of Coincidence: 0.08333333333333333/); testOpImage(browser, "Invert Image", "files/Hitchhikers_Guide.jpeg"); // testOp(browser, "JPath expression", "test input", "test_output"); + testOp(browser, "Jq", '{"a":{"b":1}}', '{"b":1}', [".a"]); testOpHtml(browser, "JSON Beautify", "{a:1}", ".json-dict .json-literal", "1"); // testOp(browser, "JSON Minify", "test input", "test_output"); // testOp(browser, "JSON to CSV", "test input", "test_output"); From cbe1d39e06dae3ab4c24b2320df6aab35b403b1b Mon Sep 17 00:00:00 2001 From: ThePlayer372-FR <64158371+ThePlayer372-FR@users.noreply.github.com> Date: Sat, 7 Mar 2026 08:29:22 +0100 Subject: [PATCH 002/208] Add Flask Session operations (Decode, Sign, Verify) (#2208) --- src/core/config/Categories.json | 5 +- src/core/operations/FlaskSessionDecode.mjs | 80 +++++++ src/core/operations/FlaskSessionSign.mjs | 89 ++++++++ src/core/operations/FlaskSessionVerify.mjs | 136 ++++++++++++ tests/operations/tests/FlaskSession.mjs | 246 +++++++++++++++++++++ 5 files changed, 555 insertions(+), 1 deletion(-) create mode 100644 src/core/operations/FlaskSessionDecode.mjs create mode 100644 src/core/operations/FlaskSessionSign.mjs create mode 100644 src/core/operations/FlaskSessionVerify.mjs create mode 100644 tests/operations/tests/FlaskSession.mjs diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index 6d6b2f39..cee966b0 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -164,7 +164,10 @@ "Typex", "Lorenz", "Colossus", - "SIGABA" + "SIGABA", + "Flask Session Decode", + "Flask Session Sign", + "Flask Session Verify" ] }, { diff --git a/src/core/operations/FlaskSessionDecode.mjs b/src/core/operations/FlaskSessionDecode.mjs new file mode 100644 index 00000000..5486357e --- /dev/null +++ b/src/core/operations/FlaskSessionDecode.mjs @@ -0,0 +1,80 @@ +/** + * @author ThePlayer372-FR [] + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import OperationError from "../errors/OperationError.mjs"; +import { fromBase64 } from "../lib/Base64.mjs"; + +/** + * Flask Session Decode operation + */ +class FlaskSessionDecode extends Operation { + /** + * FlaskSessionDecode constructor + */ + constructor() { + super(); + + this.name = "Flask Session Decode"; + this.module = "Crypto"; + this.description = "Decodes the payload of a Flask session cookie (itsdangerous) into JSON."; + this.inputType = "string"; + this.outputType = "JSON"; + this.args = [ + { + name: "View TimeStamp", + type: "boolean", + value: false + } + ]; + } + + /** + * @param {string} input + * @param {Object[]} args + * @returns {Object[]} + */ + run(input, args) { + input = input.trim(); + const parts = input.split("."); + if (parts.length !== 3) { + throw new OperationError("Invalid Flask token format. Expected payload.timestamp.signature"); + } + + const payloadB64 = parts[0]; + const time = parts[1]; + + const timeB64 = time.replace(/-/g, "+").replace(/_/g, "/"); + const binary = fromBase64(timeB64); + const bytes = new Uint8Array(4); + for (let i = 0; i < 4; i++) { + bytes[i] = binary.charCodeAt(i); + } + const view = new DataView(bytes.buffer); + const timestamp = view.getInt32(0, false); + + const base64 = payloadB64.replace(/-/g, "+").replace(/_/g, "/"); + const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "="); + let payloadJson; + try { + payloadJson = fromBase64(padded); + } catch (e) { + throw new OperationError("Invalid Base64 payload"); + } + + try { + let data = JSON.parse(payloadJson); + + if (args[0]) { + data = {payload: data, timestamp: timestamp}; + } + return data; + } catch (e) { + throw new OperationError("Unable to decode JSON payload: " + e.message); + } + } +} + +export default FlaskSessionDecode; diff --git a/src/core/operations/FlaskSessionSign.mjs b/src/core/operations/FlaskSessionSign.mjs new file mode 100644 index 00000000..01ee8b1d --- /dev/null +++ b/src/core/operations/FlaskSessionSign.mjs @@ -0,0 +1,89 @@ +/** + * @author ThePlayer372-FR [] + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import CryptoApi from "crypto-api/src/crypto-api.mjs"; +import Utils from "../Utils.mjs"; +import { toBase64 } from "../lib/Base64.mjs"; +import OperationError from "../errors/OperationError.mjs"; + +/** + * Flask Session Sign operation + */ +class FlaskSessionSign extends Operation { + /** + * FlaskSessionSign constructor + */ + constructor() { + super(); + + this.name = "Flask Session Sign"; + this.module = "Crypto"; + this.description = "Signs a JSON payload to produce a Flask session cookie (itsdangerous HMAC)."; + this.inputType = "JSON"; + this.outputType = "string"; + this.args = [ + { + name: "Key", + type: "toggleString", + value: "", + toggleValues: ["Hex", "Decimal", "Binary", "Base64", "UTF8", "Latin1"] + }, + { + name: "Salt", + type: "toggleString", + value: "cookie-session", + toggleValues: ["UTF8", "Hex", "Decimal", "Binary", "Base64", "Latin1"] + }, + { + name: "Algorithm", + type: "option", + value: ["sha1", "sha256"], + } + ]; + } + + /** + * @param {string} input + * @param {Object[]} args + * @returns {string} + */ + run(input, args) { + if (!args[0].string) { + throw new OperationError("Secret key required"); + } + const key = Utils.convertToByteString(args[0].string, args[0].option); + const salt = Utils.convertToByteString(args[1].string || "cookie-session", args[1].option); + const algorithm = args[2] || "sha1"; + + const payloadB64 = toBase64(Utils.strToByteArray(JSON.stringify(input))); + const payload = payloadB64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); + + const derivedKey = CryptoApi.getHmac(key, CryptoApi.getHasher(algorithm)); + derivedKey.update(salt); + + const currentTimeStamp = Math.ceil(Date.now() / 1000); + const buffer = new ArrayBuffer(4); + const view = new DataView(buffer); + view.setInt32(0, currentTimeStamp, false); + const bytes = new Uint8Array(buffer); + let binary = ""; + bytes.forEach(b => binary += String.fromCharCode(b)); + const timeB64 = toBase64(Utils.strToByteArray(binary)); + const time = timeB64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); + + const data = Utils.convertToByteString(payload + "." + time, "utf8"); + const sign = CryptoApi.getHmac(derivedKey.finalize(), CryptoApi.getHasher(algorithm)); + sign.update(data); + + const signB64 = toBase64(sign.finalize()); + const sign64 = signB64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); + + return payload + "." + time + "." + sign64; + } +} + + +export default FlaskSessionSign; diff --git a/src/core/operations/FlaskSessionVerify.mjs b/src/core/operations/FlaskSessionVerify.mjs new file mode 100644 index 00000000..7603ba1f --- /dev/null +++ b/src/core/operations/FlaskSessionVerify.mjs @@ -0,0 +1,136 @@ +/** + * @author ThePlayer372-FR [] + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import OperationError from "../errors/OperationError.mjs"; +import CryptoApi from "crypto-api/src/crypto-api.mjs"; +import Utils from "../Utils.mjs"; +import { toBase64, fromBase64 } from "../lib/Base64.mjs"; + +/** + * Flask Session Verify operation + */ +class FlaskSessionVerify extends Operation { + /** + * FlaskSessionVerify constructor + */ + constructor() { + super(); + + this.name = "Flask Session Verify"; + this.module = "Crypto"; + this.description = "Verifies the HMAC signature of a Flask session cookie (itsdangerous) generated."; + this.inputType = "string"; + this.outputType = "JSON"; + this.args = [ + { + name: "Key", + type: "toggleString", + value: "", + toggleValues: ["Hex", "Decimal", "Binary", "Base64", "UTF8", "Latin1"] + }, + { + name: "Salt", + type: "toggleString", + value: "cookie-session", + toggleValues: ["UTF8", "Hex", "Decimal", "Binary", "Base64", "Latin1"] + }, + { + name: "Algorithm", + type: "option", + value: ["sha1", "sha256"], + }, + { + name: "View TimeStamp", + type: "boolean", + value: true + } + ]; + } + + /** + * @param {string} input + * @param {Object[]} args + * @returns {string} + */ + run(input, args) { + + if (!args[0].string) { + throw new OperationError("Secret key required"); + } + + const key = Utils.convertToByteString(args[0].string, args[0].option); + const salt = Utils.convertToByteString(args[1].string || "cookie-session", args[1].option); + const algorithm = args[2] || "sha1"; + + input = input.trim(); + + const parts = input.split("."); + + if (parts.length !== 3) { + throw new OperationError("Invalid Flask token format. Expected payload.timestamp.signature"); + } + + const data = Utils.convertToByteString(parts[0] + "." + parts[1], "utf8"); + + + const derivedKey = CryptoApi.getHmac(key, CryptoApi.getHasher(algorithm)); + derivedKey.update(salt); + + const sign = CryptoApi.getHmac(derivedKey.finalize(), CryptoApi.getHasher(algorithm)); + sign.update(data); + + const payloadB64 = parts[0]; + const base64 = payloadB64.replace(/-/g, "+").replace(/_/g, "/"); + const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "="); + + const time = parts[1]; + + const timeB64 = time.replace(/-/g, "+").replace(/_/g, "/"); + const binary = fromBase64(timeB64); + const bytes = new Uint8Array(4); + for (let i = 0; i < 4; i++) { + bytes[i] = binary.charCodeAt(i); + } + const view = new DataView(bytes.buffer); + const timestamp = view.getInt32(0, false); + + let payloadJson; + try { + payloadJson = fromBase64(padded); + } catch (e) { + throw new OperationError("Invalid Base64 payload"); + } + + const signB64 = toBase64(sign.finalize()); + const sign64 = signB64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); + + if (sign64 !== parts[2]) { + throw new OperationError("Invalid signature!"); + } + + try { + const decoded = JSON.parse(payloadJson); + if (!args[3]) { + return { + valid: true, + payload: decoded, + }; + } else { + return { + valid: true, + payload: decoded, + timestamp: timestamp + }; + } + } catch (e) { + throw new OperationError("Unable to decode JSON payload: " + e.message); + } + + } +} + + +export default FlaskSessionVerify; diff --git a/tests/operations/tests/FlaskSession.mjs b/tests/operations/tests/FlaskSession.mjs new file mode 100644 index 00000000..7becf400 --- /dev/null +++ b/tests/operations/tests/FlaskSession.mjs @@ -0,0 +1,246 @@ +/** + * Flask Session tests + * + * @author ThePlayer372-FR [] + * + * @license Apache-2.0 + */ + +import TestRegister from "../../lib/TestRegister.mjs"; + +const validTokenSha1 = "eyJyb2xlIjoic3VwZXJ1c2VyIiwidXNlciI6ImFkbWluIn0.aZ-KEw.E_x6bOhA4GU9t72pMinJUjN-O3I"; +const validTokenSha256 = "eyJyb2xlIjoic3VwZXJ1c2VyIiwidXNlciI6ImFkbWluIn0.aab3Ew.Jsx2DOx_H9anZg0YcvhsASxQ11897EFHeQfS2oja4y8"; + +const validKey = "mysecretkey"; +const wrongKey = "notTheKey"; + +const outputObject = { + user: "admin", + role: "superuser", +}; + +const outputVerify = { + valid: true, + payload: outputObject, +}; + +TestRegister.addTests([ + { + name: "Flask Session: Decode", + input: validTokenSha1, + expectedOutput: outputObject, + recipeConfig: [ + { + op: "Flask Session Decode", + args: [ + false + ], + } + ] + }, + { + name: "Flask Session: Verify Sha1", + input: validTokenSha1, + expectedOutput: outputVerify, + recipeConfig: [ + { + op: "Flask Session Verify", + args: [ + { + string: validKey, + option: "UTF8" + }, + { + string: "cookie-session", + option: "UTF8" + }, + "sha1", + false, + ], + } + ] + }, + { + name: "Flask Session: Verify Sha256", + input: validTokenSha256, + expectedOutput: outputVerify, + recipeConfig: [ + { + op: "Flask Session Verify", + args: [ + { + string: validKey, + option: "UTF8" + }, + { + string: "cookie-session", + option: "UTF8" + }, + "sha256", + false, + ], + } + ] + }, + { + name: "Flask Session: Sign Sha1", + input: outputObject, + expectedOutput: outputVerify, + recipeConfig: [ + { + op: "Flask Session Sign", + args: [ + { + string: validKey, + option: "UTF8" + }, + { + string: "cookie-session", + option: "UTF8" + }, + "sha1" + ] + }, + { + op: "Flask Session Verify", + args: [ + { + string: validKey, + option: "UTF8" + }, + { + string: "cookie-session", + option: "UTF8" + }, + "sha1", + false, + ], + } + ] + }, + { + name: "Flask Session: Sign Sha256", + input: outputObject, + expectedOutput: outputVerify, + recipeConfig: [ + { + op: "Flask Session Sign", + args: [ + { + string: validKey, + option: "UTF8" + }, + { + string: "cookie-session", + option: "UTF8" + }, + "sha256" + ] + }, + { + op: "Flask Session Verify", + args: [ + { + string: validKey, + option: "UTF8" + }, + { + string: "cookie-session", + option: "UTF8" + }, + "sha256", + false, + ], + } + ] + }, + { + name: "Flask Session: Verify Sha1 Wrong Key", + input: validTokenSha1, + expectedOutput: "Invalid signature!", + recipeConfig: [ + { + op: "Flask Session Verify", + args: [ + { + string: wrongKey, + option: "UTF8" + }, + { + string: "cookie-session", + option: "UTF8" + }, + "sha1", + false, + ], + } + ] + }, + { + name: "Flask Session: Verify Sha256 Wrong Key", + input: validTokenSha256, + expectedOutput: "Invalid signature!", + recipeConfig: [ + { + op: "Flask Session Verify", + args: [ + { + string: wrongKey, + option: "UTF8" + }, + { + string: "cookie-session", + option: "UTF8" + }, + "sha256", + false, + ], + } + ] + }, + { + name: "Flask Session: Verify Sha1 Wrong Salt", + input: validTokenSha1, + expectedOutput: "Invalid signature!", + recipeConfig: [ + { + op: "Flask Session Verify", + args: [ + { + string: validKey, + option: "UTF8" + }, + { + string: "notTheSalt", + option: "UTF8" + }, + "sha1", + false, + ], + } + ] + }, + { + name: "Flask Session: Verify Sha256 Wrong Salt", + input: validTokenSha256, + expectedOutput: "Invalid signature!", + recipeConfig: [ + { + op: "Flask Session Verify", + args: [ + { + string: validKey, + option: "UTF8" + }, + { + string: "notTheSalt", + option: "UTF8" + }, + "sha256", + false, + ], + } + ] + }, + +]); From 15d7d5507ef2ebccb8cf2e1d314ad4283162d7f4 Mon Sep 17 00:00:00 2001 From: Swonkie <3949813+Swonkie@users.noreply.github.com> Date: Sat, 7 Mar 2026 09:20:26 +0100 Subject: [PATCH 003/208] [bugfix] #1874 Add Bootstrap form style for CodeMirror editor (#2161) --- src/web/stylesheets/utils/_overrides.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/web/stylesheets/utils/_overrides.css b/src/web/stylesheets/utils/_overrides.css index a2f8b029..fec7d857 100755 --- a/src/web/stylesheets/utils/_overrides.css +++ b/src/web/stylesheets/utils/_overrides.css @@ -249,6 +249,13 @@ optgroup { } +/* Bootstrap form inside CodeMirror editor */ + +.cm-panel > .bmd-form-group { + padding-top: 0; +} + + /* CodeMirror */ .ͼ2 .cm-specialChar, From 81b3e9abd4f460bd0c4d527384d0b0ed514680cb Mon Sep 17 00:00:00 2001 From: Thomas M <44269971+thomasxm@users.noreply.github.com> Date: Sat, 7 Mar 2026 12:07:17 +0000 Subject: [PATCH 004/208] Feat/rc6 add RC6 Encrypt/Decrypt operations (#2163) --- src/core/config/Categories.json | 2 + src/core/lib/RC6.mjs | 625 +++++++++++++++++++++++++++++ src/core/operations/RC6Decrypt.mjs | 119 ++++++ src/core/operations/RC6Encrypt.mjs | 119 ++++++ tests/operations/index.mjs | 1 + tests/operations/tests/RC6.mjs | 487 ++++++++++++++++++++++ 6 files changed, 1353 insertions(+) create mode 100644 src/core/lib/RC6.mjs create mode 100644 src/core/operations/RC6Decrypt.mjs create mode 100644 src/core/operations/RC6Encrypt.mjs create mode 100644 tests/operations/tests/RC6.mjs diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index cee966b0..e59c6aeb 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -109,6 +109,8 @@ "Rabbit", "SM4 Encrypt", "SM4 Decrypt", + "RC6 Encrypt", + "RC6 Decrypt", "GOST Encrypt", "GOST Decrypt", "GOST Sign", diff --git a/src/core/lib/RC6.mjs b/src/core/lib/RC6.mjs new file mode 100644 index 00000000..eaa6087c --- /dev/null +++ b/src/core/lib/RC6.mjs @@ -0,0 +1,625 @@ +/** + * Complete implementation of RC6 block cipher encryption/decryption with + * configurable word size (w), rounds (r), and key length (b). + * + * RC6 was an AES finalist designed by Ron Rivest, Matt Robshaw, Ray Sidney, and Yiqun Lisa Yin. + * Reference: https://en.wikipedia.org/wiki/RC6 + * Test Vectors: https://datatracker.ietf.org/doc/html/draft-krovetz-rc6-rc5-vectors-00 + * + * The P and Q constants are derived from mathematical constants e (Euler's number) and + * φ (golden ratio) as specified in the IETF draft. Master 256-bit values are scaled to + * any word size. + * + * @author Medjedtxm + * @copyright Crown Copyright 2026 + * @license Apache-2.0 + */ + +import OperationError from "../errors/OperationError.mjs"; + +/** + * Master P constant (256-bit) from IETF draft-krovetz-rc6-rc5-vectors-00 + * Derived from Odd((e-2) * 2^256) where e = 2.71828... + */ +const P_256 = 0xb7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a784d9045190cfefn; + +/** + * Master Q constant (256-bit) from IETF draft-krovetz-rc6-rc5-vectors-00 + * Derived from Odd((φ-1) * 2^256) where φ = 1.61803... (golden ratio) + */ +const Q_256 = 0x9e3779b97f4a7c15f39cc0605cedc8341082276bf3a27251f86c6a11d0c18e95n; + +/** + * Get P constant for given word size by scaling the 256-bit master constant + * @param {number} w - Word size in bits + * @returns {bigint} - P constant for word size w + */ +function getP(w) { + return (P_256 >> BigInt(256 - w)) | 1n; // Ensure odd +} + +/** + * Get Q constant for given word size by scaling the 256-bit master constant + * @param {number} w - Word size in bits + * @returns {bigint} - Q constant for word size w + */ +function getQ(w) { + return (Q_256 >> BigInt(256 - w)) | 1n; // Ensure odd +} + +/** + * Get block size in bytes for given word size + * Block size = 4 words = 4 * (w/8) bytes + * @param {number} w - Word size in bits + * @returns {number} - Block size in bytes + */ +export function getBlockSize(w) { + return 4 * (w / 8); +} + +/** + * Get recommended number of rounds for given word size + * @param {number} w - Word size in bits + * @returns {number} - Recommended rounds + */ +export function getDefaultRounds(w) { + if (w <= 16) return 16; + if (w <= 32) return 20; + if (w <= 64) return 24; + return 28; +} + +/** + * Create mask for w-bit word + * @param {number} w - Word size in bits + * @returns {bigint} - Mask with w bits set + */ +function wordMask(w) { + return (1n << BigInt(w)) - 1n; +} + +/** + * Rotate left for arbitrary word size using BigInt + * Uses lower lg(w) bits of n for rotation amount (RC6 spec) + * @param {bigint} x - Value to rotate + * @param {bigint} n - Rotation amount + * @param {number} w - Word size in bits + * @param {bigint} lgMask - Mask for lower lg(w) bits + * @returns {bigint} - Rotated value + */ +function ROL(x, n, w, lgMask) { + const mask = wordMask(w); + // Mask to lg(w) bits, then mod w for non-power-of-2 word sizes + // For power-of-2, (n & lgMask) < w always, so mod w is no-op + const shift = (n & lgMask) % BigInt(w); + return ((x << shift) | (x >> (BigInt(w) - shift))) & mask; +} + +/** + * Rotate right for arbitrary word size using BigInt + * Uses lower lg(w) bits of n for rotation amount (RC6 spec) + * @param {bigint} x - Value to rotate + * @param {bigint} n - Rotation amount + * @param {number} w - Word size in bits + * @param {bigint} lgMask - Mask for lower lg(w) bits + * @returns {bigint} - Rotated value + */ +function ROR(x, n, w, lgMask) { + const mask = wordMask(w); + // Mask to lg(w) bits, then mod w for non-power-of-2 word sizes + // For power-of-2, (n & lgMask) < w always, so mod w is no-op + const shift = (n & lgMask) % BigInt(w); + return ((x >> shift) | (x << (BigInt(w) - shift))) & mask; +} + +/** + * Convert byte array to word array (little-endian) using BigInt + * @param {number[]} bytes - Input byte array + * @param {number} w - Word size in bits + * @returns {bigint[]} - Array of w-bit words as BigInt + */ +function bytesToWords(bytes, w) { + const bytesPerWord = w / 8; + const words = []; + for (let i = 0; i < bytes.length; i += bytesPerWord) { + let word = 0n; + for (let j = 0; j < bytesPerWord && (i + j) < bytes.length; j++) { + word |= BigInt(bytes[i + j] || 0) << BigInt(j * 8); + } + words.push(word); + } + return words; +} + +/** + * Convert word array to byte array (little-endian) using BigInt + * @param {bigint[]} words - Array of words + * @param {number} w - Word size in bits + * @returns {number[]} - Output byte array + */ +function wordsToBytes(words, w) { + const bytesPerWord = w / 8; + const bytes = []; + for (const word of words) { + for (let j = 0; j < bytesPerWord; j++) { + bytes.push(Number((word >> BigInt(j * 8)) & 0xFFn)); + } + } + return bytes; +} + +/** + * Generate round subkeys from user key + * + * @param {number[]} key - User key as byte array + * @param {number} rounds - Number of rounds + * @param {number} w - Word size in bits + * @returns {bigint[]} - Array of 2r+4 subkeys as BigInt + */ +function generateSubkeys(key, rounds, w) { + const bytesPerWord = w / 8; + const b = key.length; + const c = Math.max(Math.ceil(b / bytesPerWord), 1); + + // Convert key bytes to words, pad with zeros if needed + const paddedKey = [...key]; + while (paddedKey.length < c * bytesPerWord) { + paddedKey.push(0); + } + const L = bytesToWords(paddedKey, w); + + // Number of subkeys: 2*r + 4 + const t = 2 * rounds + 4; + + // Get P and Q for this word size + const P = getP(w); + const Q = getQ(w); + const mask = wordMask(w); + + // lg(w) mask for rotation amounts (floor of log2(w), per RC6 spec) + const lgw = Math.floor(Math.log2(w)); + const lgMask = (1n << BigInt(lgw)) - 1n; + + // Initialise S array with magic constants + const S = new Array(t); + S[0] = P; + for (let i = 1; i < t; i++) { + S[i] = (S[i - 1] + Q) & mask; + } + + // Mix key into S + let A = 0n, B = 0n; + let i = 0, j = 0; + const v = 3 * Math.max(c, t); + + for (let s = 0; s < v; s++) { + A = S[i] = ROL((S[i] + A + B) & mask, 3n, w, lgMask); + B = L[j] = ROL((L[j] + A + B) & mask, A + B, w, lgMask); + i = (i + 1) % t; + j = (j + 1) % c; + } + + return S; +} + +/** + * Encrypt a single block using RC6 + * + * @param {number[]} block - Plaintext block (4*w/8 bytes) + * @param {bigint[]} S - Subkeys array + * @param {number} rounds - Number of rounds + * @param {number} w - Word size in bits + * @returns {number[]} - Ciphertext block + */ +function encryptBlock(block, S, rounds, w) { + const mask = wordMask(w); + const lgw = BigInt(Math.floor(Math.log2(w))); + const lgMask = (1n << lgw) - 1n; + + // Convert block to 4 words (A, B, C, D) + let [A, B, C, D] = bytesToWords(block, w); + + // Pre-whitening + B = (B + S[0]) & mask; + D = (D + S[1]) & mask; + + // Main rounds + for (let i = 1; i <= rounds; i++) { + // t = ROL(B * (2B + 1), lg(w)) + const t = ROL((B * ((2n * B + 1n) & mask)) & mask, lgw, w, lgMask); + + // u = ROL(D * (2D + 1), lg(w)) + const u = ROL((D * ((2n * D + 1n) & mask)) & mask, lgw, w, lgMask); + + // A = ROL(A ^ t, u) + S[2i] + A = (ROL(A ^ t, u, w, lgMask) + S[2 * i]) & mask; + + // C = ROL(C ^ u, t) + S[2i + 1] + C = (ROL(C ^ u, t, w, lgMask) + S[2 * i + 1]) & mask; + + // Rotate registers: (A, B, C, D) = (B, C, D, A) + const temp = A; + A = B; + B = C; + C = D; + D = temp; + } + + // Post-whitening + A = (A + S[2 * rounds + 2]) & mask; + C = (C + S[2 * rounds + 3]) & mask; + + // Convert words back to bytes + return wordsToBytes([A, B, C, D], w); +} + +/** + * Decrypt a single block using RC6 + * + * @param {number[]} block - Ciphertext block (4*w/8 bytes) + * @param {bigint[]} S - Subkeys array + * @param {number} rounds - Number of rounds + * @param {number} w - Word size in bits + * @returns {number[]} - Plaintext block + */ +function decryptBlock(block, S, rounds, w) { + const mask = wordMask(w); + const lgw = BigInt(Math.floor(Math.log2(w))); + const lgMask = (1n << lgw) - 1n; + + // Convert block to 4 words (A, B, C, D) + let [A, B, C, D] = bytesToWords(block, w); + + // Reverse post-whitening + C = (C - S[2 * rounds + 3] + (1n << BigInt(w))) & mask; + A = (A - S[2 * rounds + 2] + (1n << BigInt(w))) & mask; + + // Main rounds in reverse + for (let i = rounds; i >= 1; i--) { + // Reverse rotate registers: (A, B, C, D) = (D, A, B, C) + const temp = D; + D = C; + C = B; + B = A; + A = temp; + + // u = ROL(D * (2D + 1), lg(w)) + const u = ROL((D * ((2n * D + 1n) & mask)) & mask, lgw, w, lgMask); + + // t = ROL(B * (2B + 1), lg(w)) + const t = ROL((B * ((2n * B + 1n) & mask)) & mask, lgw, w, lgMask); + + // C = ROR(C - S[2i + 1], t) ^ u + C = ROR((C - S[2 * i + 1] + (1n << BigInt(w))) & mask, t, w, lgMask) ^ u; + + // A = ROR(A - S[2i], u) ^ t + A = ROR((A - S[2 * i] + (1n << BigInt(w))) & mask, u, w, lgMask) ^ t; + } + + // Reverse pre-whitening + D = (D - S[1] + (1n << BigInt(w))) & mask; + B = (B - S[0] + (1n << BigInt(w))) & mask; + + // Convert words back to bytes + return wordsToBytes([A, B, C, D], w); +} + +/** + * XOR two blocks + * @param {number[]} a - First block + * @param {number[]} b - Second block + * @returns {number[]} - XOR result + */ +function xorBlocks(a, b) { + const result = new Array(a.length); + for (let i = 0; i < a.length; i++) { + result[i] = a[i] ^ b[i]; + } + return result; +} + +/** + * Increment counter (little-endian) + * @param {number[]} counter - Counter block + * @returns {number[]} - Incremented counter + */ +function incrementCounter(counter) { + const result = [...counter]; + for (let i = 0; i < result.length; i++) { + result[i]++; + if (result[i] <= 255) break; + result[i] = 0; + } + return result; +} + +/** + * Apply padding to message + * @param {number[]} message - Original message + * @param {string} padding - Padding type ("NO", "PKCS5", "ZERO", "RANDOM", "BIT") + * @param {number} blockSize - Block size in bytes + * @returns {number[]} - Padded message + */ +function applyPadding(message, padding, blockSize) { + const remainder = message.length % blockSize; + let nPadding = remainder === 0 ? 0 : blockSize - remainder; + + // For PKCS5, always add at least one byte (full block if already aligned) + if (padding === "PKCS5" && remainder === 0) { + nPadding = blockSize; + } + + if (nPadding === 0) return [...message]; + + const paddedMessage = [...message]; + + switch (padding) { + case "NO": + throw new OperationError(`No padding requested but input is not a ${blockSize}-byte multiple.`); + + case "PKCS5": + for (let i = 0; i < nPadding; i++) { + paddedMessage.push(nPadding); + } + break; + + case "ZERO": + for (let i = 0; i < nPadding; i++) { + paddedMessage.push(0); + } + break; + + case "RANDOM": + for (let i = 0; i < nPadding; i++) { + paddedMessage.push(Math.floor(Math.random() * 256)); + } + break; + + case "BIT": + paddedMessage.push(0x80); + for (let i = 1; i < nPadding; i++) { + paddedMessage.push(0); + } + break; + + default: + throw new OperationError(`Unknown padding type: ${padding}`); + } + + return paddedMessage; +} + +/** + * Remove padding from message + * @param {number[]} message - Padded message + * @param {string} padding - Padding type ("NO", "PKCS5", "ZERO", "RANDOM", "BIT") + * @param {number} blockSize - Block size in bytes + * @returns {number[]} - Unpadded message + */ +function removePadding(message, padding, blockSize) { + if (message.length === 0) return message; + + switch (padding) { + case "NO": + case "ZERO": + case "RANDOM": + // These padding types cannot be reliably removed + return message; + + case "PKCS5": { + const padByte = message[message.length - 1]; + if (padByte > 0 && padByte <= blockSize) { + // Verify padding + for (let i = 0; i < padByte; i++) { + if (message[message.length - 1 - i] !== padByte) { + throw new OperationError("Invalid PKCS#5 padding."); + } + } + return message.slice(0, message.length - padByte); + } + throw new OperationError("Invalid PKCS#5 padding."); + } + + case "BIT": { + // Find 0x80 byte working backwards, skipping zeros + for (let i = message.length - 1; i >= 0; i--) { + if (message[i] === 0x80) { + return message.slice(0, i); + } else if (message[i] !== 0) { + throw new OperationError("Invalid BIT padding."); + } + } + throw new OperationError("Invalid BIT padding."); + } + + default: + throw new OperationError(`Unknown padding type: ${padding}`); + } +} + +/** + * Encrypt using RC6 cipher with specified block mode + * + * @param {number[]} message - Plaintext as byte array + * @param {number[]} key - Key as byte array + * @param {number[]} iv - IV (block size bytes, not used for ECB) + * @param {string} mode - Block cipher mode ("ECB", "CBC", "CFB", "OFB", "CTR") + * @param {string} padding - Padding type ("NO", "PKCS5", "ZERO", "RANDOM", "BIT") + * @param {number} rounds - Number of rounds (default: 20) + * @param {number} w - Word size in bits (default: 32) + * @returns {number[]} - Ciphertext as byte array + */ +export function encryptRC6(message, key, iv, mode = "ECB", padding = "PKCS5", rounds = 20, w = 32) { + const blockSize = getBlockSize(w); + const messageLength = message.length; + if (messageLength === 0) return []; + + const S = generateSubkeys(key, rounds, w); + + // Apply padding for ECB/CBC modes + let paddedMessage; + if (mode === "ECB" || mode === "CBC") { + paddedMessage = applyPadding(message, padding, blockSize); + } else { + // Stream modes (CFB, OFB, CTR) don't need padding + paddedMessage = [...message]; + } + + const cipherText = []; + + switch (mode) { + case "ECB": + for (let i = 0; i < paddedMessage.length; i += blockSize) { + const block = paddedMessage.slice(i, i + blockSize); + cipherText.push(...encryptBlock(block, S, rounds, w)); + } + break; + + case "CBC": { + let ivBlock = [...iv]; + for (let i = 0; i < paddedMessage.length; i += blockSize) { + const block = paddedMessage.slice(i, i + blockSize); + const xored = xorBlocks(block, ivBlock); + ivBlock = encryptBlock(xored, S, rounds, w); + cipherText.push(...ivBlock); + } + break; + } + + case "CFB": { + let ivBlock = [...iv]; + for (let i = 0; i < paddedMessage.length; i += blockSize) { + const encrypted = encryptBlock(ivBlock, S, rounds, w); + const block = paddedMessage.slice(i, i + blockSize); + // Pad block if shorter than blockSize + while (block.length < blockSize) block.push(0); + ivBlock = xorBlocks(encrypted, block); + cipherText.push(...ivBlock); + } + return cipherText.slice(0, messageLength); + } + + case "OFB": { + let ivBlock = [...iv]; + for (let i = 0; i < paddedMessage.length; i += blockSize) { + ivBlock = encryptBlock(ivBlock, S, rounds, w); + const block = paddedMessage.slice(i, i + blockSize); + // Pad block if shorter than blockSize + while (block.length < blockSize) block.push(0); + cipherText.push(...xorBlocks(ivBlock, block)); + } + return cipherText.slice(0, messageLength); + } + + case "CTR": { + let counter = [...iv]; + for (let i = 0; i < paddedMessage.length; i += blockSize) { + const encrypted = encryptBlock(counter, S, rounds, w); + const block = paddedMessage.slice(i, i + blockSize); + // Pad block if shorter than blockSize + while (block.length < blockSize) block.push(0); + cipherText.push(...xorBlocks(encrypted, block)); + counter = incrementCounter(counter); + } + return cipherText.slice(0, messageLength); + } + + default: + throw new OperationError(`Invalid block cipher mode: ${mode}`); + } + + return cipherText; +} + +/** + * Decrypt using RC6 cipher with specified block mode + * + * @param {number[]} cipherText - Ciphertext as byte array + * @param {number[]} key - Key as byte array + * @param {number[]} iv - IV (block size bytes, not used for ECB) + * @param {string} mode - Block cipher mode ("ECB", "CBC", "CFB", "OFB", "CTR") + * @param {string} padding - Padding type ("NO", "PKCS5", "ZERO", "RANDOM", "BIT") + * @param {number} rounds - Number of rounds (default: 20) + * @param {number} w - Word size in bits (default: 32) + * @returns {number[]} - Plaintext as byte array + */ +export function decryptRC6(cipherText, key, iv, mode = "ECB", padding = "PKCS5", rounds = 20, w = 32) { + const blockSize = getBlockSize(w); + const originalLength = cipherText.length; + if (originalLength === 0) return []; + + const S = generateSubkeys(key, rounds, w); + + if (mode === "ECB" || mode === "CBC") { + if ((originalLength % blockSize) !== 0) + throw new OperationError(`Invalid ciphertext length: ${originalLength} bytes. Must be a multiple of ${blockSize}.`); + } else { + // Pad for stream modes + while ((cipherText.length % blockSize) !== 0) + cipherText.push(0); + } + + const plainText = []; + + switch (mode) { + case "ECB": + for (let i = 0; i < cipherText.length; i += blockSize) { + const block = cipherText.slice(i, i + blockSize); + plainText.push(...decryptBlock(block, S, rounds, w)); + } + break; + + case "CBC": { + let ivBlock = [...iv]; + for (let i = 0; i < cipherText.length; i += blockSize) { + const block = cipherText.slice(i, i + blockSize); + const decrypted = decryptBlock(block, S, rounds, w); + plainText.push(...xorBlocks(decrypted, ivBlock)); + ivBlock = block; + } + break; + } + + case "CFB": { + let ivBlock = [...iv]; + for (let i = 0; i < cipherText.length; i += blockSize) { + const encrypted = encryptBlock(ivBlock, S, rounds, w); + const block = cipherText.slice(i, i + blockSize); + plainText.push(...xorBlocks(encrypted, block)); + ivBlock = block; + } + return plainText.slice(0, originalLength); + } + + case "OFB": { + let ivBlock = [...iv]; + for (let i = 0; i < cipherText.length; i += blockSize) { + ivBlock = encryptBlock(ivBlock, S, rounds, w); + const block = cipherText.slice(i, i + blockSize); + plainText.push(...xorBlocks(ivBlock, block)); + } + return plainText.slice(0, originalLength); + } + + case "CTR": { + let counter = [...iv]; + for (let i = 0; i < cipherText.length; i += blockSize) { + const encrypted = encryptBlock(counter, S, rounds, w); + const block = cipherText.slice(i, i + blockSize); + plainText.push(...xorBlocks(encrypted, block)); + counter = incrementCounter(counter); + } + return plainText.slice(0, originalLength); + } + + default: + throw new OperationError(`Invalid block cipher mode: ${mode}`); + } + + // Remove padding for ECB/CBC modes + if (mode === "ECB" || mode === "CBC") { + return removePadding(plainText, padding, blockSize); + } + + return plainText.slice(0, originalLength); +} diff --git a/src/core/operations/RC6Decrypt.mjs b/src/core/operations/RC6Decrypt.mjs new file mode 100644 index 00000000..3185b632 --- /dev/null +++ b/src/core/operations/RC6Decrypt.mjs @@ -0,0 +1,119 @@ +/** + * @author Medjedtxm + * @copyright Crown Copyright 2026 + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import Utils from "../Utils.mjs"; +import OperationError from "../errors/OperationError.mjs"; +import { toHex } from "../lib/Hex.mjs"; +import { decryptRC6, getBlockSize, getDefaultRounds } from "../lib/RC6.mjs"; + +/** + * RC6 Decrypt operation + */ +class RC6Decrypt extends Operation { + + /** + * RC6Decrypt constructor + */ + constructor() { + super(); + + this.name = "RC6 Decrypt"; + this.module = "Ciphers"; + this.description = "RC6 is a symmetric key block cipher derived from RC5. It was designed by Ron Rivest, Matt Robshaw, Ray Sidney, and Yiqun Lisa Yin to meet the requirements of the AES competition, and was one of the five finalists.

RC6 is parameterised as RC6-w/r/b where w is word size in bits (any multiple of 8 from 8-256), r is the number of rounds (1-255), and b is the key length in bytes. The standard AES submission uses w=32, r=20. Common word sizes: 8, 16, 32 (standard), 64, 128.

IV: The Initialisation Vector should be 4*w/8 bytes (e.g. 16 bytes for w=32). If not entered, it will default to null bytes.

Padding: In CBC and ECB mode, the PKCS#7 padding scheme is used."; + this.infoURL = "https://wikipedia.org/wiki/RC6"; + this.inputType = "string"; + this.outputType = "string"; + this.args = [ + { + "name": "Key", + "type": "toggleString", + "value": "", + "toggleValues": ["Hex", "UTF8", "Latin1", "Base64"] + }, + { + "name": "IV", + "type": "toggleString", + "value": "", + "toggleValues": ["Hex", "UTF8", "Latin1", "Base64"] + }, + { + "name": "Mode", + "type": "option", + "value": ["CBC", "CFB", "OFB", "CTR", "ECB"] + }, + { + "name": "Input", + "type": "option", + "value": ["Hex", "Raw"] + }, + { + "name": "Output", + "type": "option", + "value": ["Raw", "Hex"] + }, + { + "name": "Padding", + "type": "option", + "value": ["PKCS5", "NO", "ZERO", "RANDOM", "BIT"] + }, + { + "name": "Word Size", + "type": "number", + "value": 32, + "min": 8, + "max": 256, + "step": 8 + }, + { + "name": "Rounds", + "type": "number", + "value": 20, + "min": 1, + "max": 255 + } + ]; + } + + /** + * @param {string} input + * @param {Object[]} args + * @returns {string} + */ + run(input, args) { + const key = Utils.convertToByteArray(args[0].string, args[0].option), + iv = Utils.convertToByteArray(args[1].string, args[1].option), + [,, mode, inputType, outputType, padding, wordSize, rounds] = args; + + // Validate word size + if (!Number.isInteger(wordSize) || wordSize < 8 || wordSize > 256 || wordSize % 8 !== 0) + throw new OperationError(`Invalid word size: ${wordSize}. Must be a multiple of 8 between 8 and 256.`); + + const blockSize = getBlockSize(wordSize); + const defaultRounds = getDefaultRounds(wordSize); + + if (iv.length !== blockSize && iv.length !== 0 && mode !== "ECB") + throw new OperationError(`Invalid IV length: ${iv.length} bytes + +RC6-${wordSize} uses an IV length of ${blockSize} bytes (${blockSize * 8} bits). +Make sure you have specified the type correctly (e.g. Hex vs UTF8).`); + + if (!Number.isInteger(rounds) || rounds < 1 || rounds > 255) + throw new OperationError(`Invalid number of rounds: ${rounds} + +Rounds must be an integer between 1 and 255. Standard for w=${wordSize} is ${defaultRounds}.`); + + // Default IV to null bytes if empty (like AES) + const actualIv = iv.length === 0 ? new Array(blockSize).fill(0) : iv; + + input = Utils.convertToByteArray(input, inputType); + const output = decryptRC6(input, key, actualIv, mode, padding, rounds, wordSize); + return outputType === "Hex" ? toHex(output, "") : Utils.byteArrayToUtf8(output); + } + +} + +export default RC6Decrypt; diff --git a/src/core/operations/RC6Encrypt.mjs b/src/core/operations/RC6Encrypt.mjs new file mode 100644 index 00000000..d5ad6d7f --- /dev/null +++ b/src/core/operations/RC6Encrypt.mjs @@ -0,0 +1,119 @@ +/** + * @author Medjedtxm + * @copyright Crown Copyright 2026 + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import Utils from "../Utils.mjs"; +import OperationError from "../errors/OperationError.mjs"; +import { toHex } from "../lib/Hex.mjs"; +import { encryptRC6, getBlockSize, getDefaultRounds } from "../lib/RC6.mjs"; + +/** + * RC6 Encrypt operation + */ +class RC6Encrypt extends Operation { + + /** + * RC6Encrypt constructor + */ + constructor() { + super(); + + this.name = "RC6 Encrypt"; + this.module = "Ciphers"; + this.description = "RC6 is a symmetric key block cipher derived from RC5. It was designed by Ron Rivest, Matt Robshaw, Ray Sidney, and Yiqun Lisa Yin to meet the requirements of the AES competition, and was one of the five finalists.

RC6 is parameterised as RC6-w/r/b where w is word size in bits (any multiple of 8 from 8-256), r is the number of rounds (1-255), and b is the key length in bytes. The standard AES submission uses w=32, r=20. Common word sizes: 8, 16, 32 (standard), 64, 128.

IV: The Initialisation Vector should be 4*w/8 bytes (e.g. 16 bytes for w=32). If not entered, it will default to null bytes.

Padding: In CBC and ECB mode, the PKCS#7 padding scheme is used."; + this.infoURL = "https://wikipedia.org/wiki/RC6"; + this.inputType = "string"; + this.outputType = "string"; + this.args = [ + { + "name": "Key", + "type": "toggleString", + "value": "", + "toggleValues": ["Hex", "UTF8", "Latin1", "Base64"] + }, + { + "name": "IV", + "type": "toggleString", + "value": "", + "toggleValues": ["Hex", "UTF8", "Latin1", "Base64"] + }, + { + "name": "Mode", + "type": "option", + "value": ["CBC", "CFB", "OFB", "CTR", "ECB"] + }, + { + "name": "Input", + "type": "option", + "value": ["Raw", "Hex"] + }, + { + "name": "Output", + "type": "option", + "value": ["Hex", "Raw"] + }, + { + "name": "Padding", + "type": "option", + "value": ["PKCS5", "NO", "ZERO", "RANDOM", "BIT"] + }, + { + "name": "Word Size", + "type": "number", + "value": 32, + "min": 8, + "max": 256, + "step": 8 + }, + { + "name": "Rounds", + "type": "number", + "value": 20, + "min": 1, + "max": 255 + } + ]; + } + + /** + * @param {string} input + * @param {Object[]} args + * @returns {string} + */ + run(input, args) { + const key = Utils.convertToByteArray(args[0].string, args[0].option), + iv = Utils.convertToByteArray(args[1].string, args[1].option), + [,, mode, inputType, outputType, padding, wordSize, rounds] = args; + + // Validate word size + if (!Number.isInteger(wordSize) || wordSize < 8 || wordSize > 256 || wordSize % 8 !== 0) + throw new OperationError(`Invalid word size: ${wordSize}. Must be a multiple of 8 between 8 and 256.`); + + const blockSize = getBlockSize(wordSize); + const defaultRounds = getDefaultRounds(wordSize); + + if (iv.length !== blockSize && iv.length !== 0 && mode !== "ECB") + throw new OperationError(`Invalid IV length: ${iv.length} bytes + +RC6-${wordSize} uses an IV length of ${blockSize} bytes (${blockSize * 8} bits). +Make sure you have specified the type correctly (e.g. Hex vs UTF8).`); + + if (!Number.isInteger(rounds) || rounds < 1 || rounds > 255) + throw new OperationError(`Invalid number of rounds: ${rounds} + +Rounds must be an integer between 1 and 255. Standard for w=${wordSize} is ${defaultRounds}.`); + + // Default IV to null bytes if empty (like AES) + const actualIv = iv.length === 0 ? new Array(blockSize).fill(0) : iv; + + input = Utils.convertToByteArray(input, inputType); + const output = encryptRC6(input, key, actualIv, mode, padding, rounds, wordSize); + return outputType === "Hex" ? toHex(output, "") : Utils.byteArrayToUtf8(output); + } + +} + +export default RC6Encrypt; diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 9d803bcc..493afd67 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -152,6 +152,7 @@ import "./tests/Shuffle.mjs"; import "./tests/SIGABA.mjs"; import "./tests/SM2.mjs"; import "./tests/SM4.mjs"; +import "./tests/RC6.mjs"; // import "./tests/SplitColourChannels.mjs"; // Cannot test operations that use the File type yet import "./tests/SQLBeautify.mjs"; import "./tests/StrUtils.mjs"; diff --git a/tests/operations/tests/RC6.mjs b/tests/operations/tests/RC6.mjs new file mode 100644 index 00000000..b9159ce3 --- /dev/null +++ b/tests/operations/tests/RC6.mjs @@ -0,0 +1,487 @@ +/** + * RC6 cipher tests. + * + * Test vectors from the IETF draft: + * "Test Vectors for RC6 and RC5" + * https://datatracker.ietf.org/doc/html/draft-krovetz-rc6-rc5-vectors-00 + * + * @author Medjedtxm + * @copyright Crown Copyright 2026 + * @license Apache-2.0 + */ + +import TestRegister from "../../lib/TestRegister.mjs"; + +TestRegister.addTests([ + // ============================================================ + // IETF TEST VECTORS - RC6-8/12/4 + // ============================================================ + { + name: "RC6-8/12/4: IETF vector encrypt", + input: "00010203", + expectedOutput: "aefc4612", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "00010203", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 8, 12 + ] + } + ] + }, + { + name: "RC6-8/12/4: IETF vector decrypt", + input: "aefc4612", + expectedOutput: "00010203", + recipeConfig: [ + { + op: "RC6 Decrypt", + args: [ + { string: "00010203", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 8, 12 + ] + } + ] + }, + + // ============================================================ + // IETF TEST VECTORS - RC6-16/16/8 + // ============================================================ + { + name: "RC6-16/16/8: IETF vector encrypt", + input: "0001020304050607", + expectedOutput: "2ff0b68eaeffad5b", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "0001020304050607", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 16, 16 + ] + } + ] + }, + { + name: "RC6-16/16/8: IETF vector decrypt", + input: "2ff0b68eaeffad5b", + expectedOutput: "0001020304050607", + recipeConfig: [ + { + op: "RC6 Decrypt", + args: [ + { string: "0001020304050607", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 16, 16 + ] + } + ] + }, + + // ============================================================ + // IETF TEST VECTORS - RC6-32/20/16 (AES standard) + // ============================================================ + { + name: "RC6-32/20/16: IETF vector encrypt (AES standard)", + input: "000102030405060708090a0b0c0d0e0f", + expectedOutput: "3a96f9c7f6755cfe46f00e3dcd5d2a3c", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 32, 20 + ] + } + ] + }, + { + name: "RC6-32/20/16: IETF vector decrypt (AES standard)", + input: "3a96f9c7f6755cfe46f00e3dcd5d2a3c", + expectedOutput: "000102030405060708090a0b0c0d0e0f", + recipeConfig: [ + { + op: "RC6 Decrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 32, 20 + ] + } + ] + }, + + // ============================================================ + // IETF TEST VECTORS - RC6-64/24/24 + // ============================================================ + { + name: "RC6-64/24/24: IETF vector encrypt", + input: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + expectedOutput: "c002de050bd55e5d36864ab9853338e6dc4a1326c6bdaaeb1bc9e4fd67886617", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f1011121314151617", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 64, 24 + ] + } + ] + }, + { + name: "RC6-64/24/24: IETF vector decrypt", + input: "c002de050bd55e5d36864ab9853338e6dc4a1326c6bdaaeb1bc9e4fd67886617", + expectedOutput: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + recipeConfig: [ + { + op: "RC6 Decrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f1011121314151617", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 64, 24 + ] + } + ] + }, + + // ============================================================ + // IETF TEST VECTORS - RC6-128/28/32 + // ============================================================ + { + name: "RC6-128/28/32: IETF vector encrypt", + input: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + expectedOutput: "4ed87c64baffecd4303ee6a79aafaef575b351c024272be70a70b4a392cfc157dba52d529a79e83845bf43d67545383aed3dbf4f0d23640e44cbf6cdaa034dcb", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 128, 28 + ] + } + ] + }, + { + name: "RC6-128/28/32: IETF vector decrypt", + input: "4ed87c64baffecd4303ee6a79aafaef575b351c024272be70a70b4a392cfc157dba52d529a79e83845bf43d67545383aed3dbf4f0d23640e44cbf6cdaa034dcb", + expectedOutput: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + recipeConfig: [ + { + op: "RC6 Decrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 128, 28 + ] + } + ] + }, + + // ============================================================ + // IETF TEST VECTORS - RC6-24/4/0 (non-power-of-2) + // ============================================================ + { + name: "RC6-24/4/0: IETF non-standard vector encrypt (w=24, empty key)", + input: "000102030405060708090a0b", + expectedOutput: "0177982579be2ee3303269b9", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 24, 4 + ] + } + ] + }, + { + name: "RC6-24/4/0: IETF non-standard vector decrypt (w=24, empty key)", + input: "0177982579be2ee3303269b9", + expectedOutput: "000102030405060708090a0b", + recipeConfig: [ + { + op: "RC6 Decrypt", + args: [ + { string: "", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 24, 4 + ] + } + ] + }, + + // ============================================================ + // IETF TEST VECTORS - RC6-80/4/12 (non-power-of-2) + // ============================================================ + { + name: "RC6-80/4/12: IETF non-standard vector encrypt (w=80)", + input: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2021222324252627", + expectedOutput: "26d9d6128601d06dec3817d401f1c0ff715473543875da417c2116d1e87c919a49311b00b4e17962", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "000102030405060708090a0b", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 80, 4 + ] + } + ] + }, + { + name: "RC6-80/4/12: IETF non-standard vector decrypt (w=80)", + input: "26d9d6128601d06dec3817d401f1c0ff715473543875da417c2116d1e87c919a49311b00b4e17962", + expectedOutput: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2021222324252627", + recipeConfig: [ + { + op: "RC6 Decrypt", + args: [ + { string: "000102030405060708090a0b", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 80, 4 + ] + } + ] + }, + + // ============================================================ + // ADDITIONAL KEY SIZE TESTS - RC6-32 (192-bit and 256-bit keys) + // ============================================================ + { + name: "RC6-32/20/24: 192-bit key encrypt", + input: "000102030405060708090a0b0c0d0e0f", + expectedOutput: "a68a14ff1342262a2bbd21f7966615eb", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f1011121314151617", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 32, 20 + ] + } + ] + }, + { + name: "RC6-32/20/32: 256-bit key encrypt", + input: "000102030405060708090a0b0c0d0e0f", + expectedOutput: "921c3ecd43d9426a90089334d67aea2e", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Hex", "NO", 32, 20 + ] + } + ] + }, + + // ============================================================ + // ROUND-TRIP TESTS - One per word size to verify encrypt/decrypt + // ============================================================ + { + name: "RC6-8 Round-trip: CBC mode", + input: "Hello World!", + expectedOutput: "Hello World!", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "mysecret", option: "UTF8" }, + { string: "abcd", option: "UTF8" }, + "CBC", "Raw", "Hex", "PKCS5", 8, 12 + ] + }, + { + op: "RC6 Decrypt", + args: [ + { string: "mysecret", option: "UTF8" }, + { string: "abcd", option: "UTF8" }, + "CBC", "Hex", "Raw", "PKCS5", 8, 12 + ] + } + ] + }, + { + name: "RC6-16 Round-trip: CBC mode", + input: "The quick brown fox", + expectedOutput: "The quick brown fox", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "secretkey1234567", option: "UTF8" }, + { string: "initvec!", option: "UTF8" }, + "CBC", "Raw", "Hex", "PKCS5", 16, 16 + ] + }, + { + op: "RC6 Decrypt", + args: [ + { string: "secretkey1234567", option: "UTF8" }, + { string: "initvec!", option: "UTF8" }, + "CBC", "Hex", "Raw", "PKCS5", 16, 16 + ] + } + ] + }, + { + name: "RC6-32 Round-trip: CBC mode", + input: "The quick brown fox jumps over the lazy dog", + expectedOutput: "The quick brown fox jumps over the lazy dog", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "aabbccddeeff00112233445566778899", option: "Hex" }, + { string: "00112233445566778899aabbccddeeff", option: "Hex" }, + "CBC", "Raw", "Hex", "PKCS5", 32, 20 + ] + }, + { + op: "RC6 Decrypt", + args: [ + { string: "aabbccddeeff00112233445566778899", option: "Hex" }, + { string: "00112233445566778899aabbccddeeff", option: "Hex" }, + "CBC", "Hex", "Raw", "PKCS5", 32, 20 + ] + } + ] + }, + { + name: "RC6-64 Round-trip: CBC mode", + input: "RC6 with 64-bit words is powerful!", + expectedOutput: "RC6 with 64-bit words is powerful!", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", option: "Hex" }, + { string: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", option: "Hex" }, + "CBC", "Raw", "Hex", "PKCS5", 64, 24 + ] + }, + { + op: "RC6 Decrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", option: "Hex" }, + { string: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", option: "Hex" }, + "CBC", "Hex", "Raw", "PKCS5", 64, 24 + ] + } + ] + }, + { + name: "RC6-128 Round-trip: ECB mode", + input: "RC6 with 128-bit words provides massive block size for testing purposes!", + expectedOutput: "RC6 with 128-bit words provides massive block size for testing purposes!", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Raw", "Hex", "PKCS5", 128, 28 + ] + }, + { + op: "RC6 Decrypt", + args: [ + { string: "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Raw", "PKCS5", 128, 28 + ] + } + ] + }, + + // ============================================================ + // STREAM MODES TEST - Verify CFB/OFB/CTR work correctly + // ============================================================ + { + name: "RC6-32 Round-trip: CTR mode", + input: "CTR mode test message", + expectedOutput: "CTR mode test message", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "00112233445566778899aabbccddeeff", option: "Hex" }, + { string: "00000000000000000000000000000001", option: "Hex" }, + "CTR", "Raw", "Hex", "PKCS5", 32, 20 + ] + }, + { + op: "RC6 Decrypt", + args: [ + { string: "00112233445566778899aabbccddeeff", option: "Hex" }, + { string: "00000000000000000000000000000001", option: "Hex" }, + "CTR", "Hex", "Raw", "PKCS5", 32, 20 + ] + } + ] + }, + + // ============================================================ + // CUSTOM ROUNDS TEST - Verify non-standard round count works + // ============================================================ + { + name: "RC6-32 Round-trip: Custom 8 rounds", + input: "Testing custom rounds", + expectedOutput: "Testing custom rounds", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "00112233445566778899aabbccddeeff", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Raw", "Hex", "PKCS5", 32, 8 + ] + }, + { + op: "RC6 Decrypt", + args: [ + { string: "00112233445566778899aabbccddeeff", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Raw", "PKCS5", 32, 8 + ] + } + ] + }, + + // ============================================================ + // EDGE CASE TEST - Padding boundary + // ============================================================ + { + name: "RC6-32 Round-trip: Exact block size input", + input: "1234567890123456", + expectedOutput: "1234567890123456", + recipeConfig: [ + { + op: "RC6 Encrypt", + args: [ + { string: "00112233445566778899aabbccddeeff", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Raw", "Hex", "PKCS5", 32, 20 + ] + }, + { + op: "RC6 Decrypt", + args: [ + { string: "00112233445566778899aabbccddeeff", option: "Hex" }, + { string: "", option: "Hex" }, + "ECB", "Hex", "Raw", "PKCS5", 32, 20 + ] + } + ] + } +]); From f759f4c43b098c7984c68c4c7a629c9cd5512df8 Mon Sep 17 00:00:00 2001 From: p-leriche <7701190+p-leriche@users.noreply.github.com> Date: Sun, 8 Mar 2026 13:46:36 +0000 Subject: [PATCH 005/208] Add Text/Integer Converter operation (#2213) Co-authored-by: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> - Additional test case added. --- src/core/config/Categories.json | 1 + src/core/operations/TextIntegerConverter.mjs | 123 +++++++++++ tests/operations/index.mjs | 1 + .../operations/tests/TextIntegerConverter.mjs | 199 ++++++++++++++++++ 4 files changed, 324 insertions(+) create mode 100644 src/core/operations/TextIntegerConverter.mjs create mode 100644 tests/operations/tests/TextIntegerConverter.mjs diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index e59c6aeb..f03fb8ea 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -41,6 +41,7 @@ "From Base", "To BCD", "From BCD", + "Text-Integer Conversion", "To HTML Entity", "From HTML Entity", "URL Encode", diff --git a/src/core/operations/TextIntegerConverter.mjs b/src/core/operations/TextIntegerConverter.mjs new file mode 100644 index 00000000..4e740100 --- /dev/null +++ b/src/core/operations/TextIntegerConverter.mjs @@ -0,0 +1,123 @@ +/** + * @author p-leriche [philip.leriche@cantab.net] + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import OperationError from "../errors/OperationError.mjs"; + +/* ---------- helper functions ---------- */ + +/** + * Convert text to BigInt (big-endian byte interpretation) + */ +function textToBigInt(text) { + if (text.length === 0) return 0n; + + let result = 0n; + for (let i = 0; i < text.length; i++) { + const charCode = BigInt(text.charCodeAt(i)); + if (charCode > 255n) { + throw new OperationError( + `Character at position ${i} exceeds Latin-1 range (0-255).\n` + + "Only ASCII and Latin-1 characters are supported."); + } + result = (result << 8n) | charCode; + } + return result; +} + +/** + * Convert BigInt to text (big-endian byte interpretation) + */ +function bigIntToText(value) { + if (value === 0n) return ""; + + const bytes = []; + let num = value; + + while (num > 0n) { + bytes.unshift(Number(num & 0xFFn)); + num >>= 8n; + } + + return String.fromCharCode(...bytes); +} + +/* ---------- operation class ---------- */ + +/** + * Text/Integer Converter operation + */ +class TextIntegerConverter extends Operation { + /** + * TextIntegerConverter constructor + */ + constructor() { + super(); + + this.description = + "Converts between text strings and large integers (decimal or hexadecimal).

" + + "Text is interpreted as a big-endian sequence of character codes. For example:
" + + "ABC is 0x414243 (hex) is 4276803 (decimal)
" + + "Input format detection:
" + + "Decimal: digits 0-9 only
" + + "Hexadecimal: 0x... prefix
" + + "Quoted or unquoted text: treated as string

" + + "Character limitations:
" + + "Text input may only contain ASCII and Latin-1 characters (code point < 256).
" + + "Multi-byte Unicode characters will generate an error.

." ; + this.infoURL = "https://wikipedia.org/wiki/Endianness"; + this.inputType = "string"; + this.outputType = "string"; + this.args = [ + { + name: "Output format", + type: "option", + value: ["String", "Decimal", "Hexadecimal"] + } + ]; + this.name = "Text-Integer Conversion"; + this.module = "Default"; + } + + /** + * @param {string} input + * @param {Object[]} args + * @returns {string} + */ + run(input, args) { + const outputFormat = args[0]; + const trimmed = input.trim(); + + let bigIntValue; + + if (!trimmed) { + // Null input - treat as zero + bigIntValue = 0; + } else if (/^0x[0-9a-f]+$/i.test(trimmed) || + /^[+-]?[0-9]+$/.test(trimmed)) { + // Hex or decimal integer + bigIntValue = BigInt(trimmed); + } else if (/^["'].*["']$/.test(trimmed)) { + // Quoted string: Remove quotes and convert text to BigInt + const text = trimmed.slice(1, -1); + bigIntValue = textToBigInt(text); + } else { + // Assume it's unquoted text + bigIntValue = textToBigInt(trimmed); + } + + // Convert to output format + if (outputFormat === "String") { + return bigIntToText(bigIntValue); + } else if (outputFormat === "Decimal") { + return bigIntValue.toString(); + } else { // Hexadecimal + return "0x" + bigIntValue.toString(16); + } + } +} + +export default TextIntegerConverter; diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 493afd67..48ff4c8e 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -165,6 +165,7 @@ import "./tests/SymmetricDifference.mjs"; import "./tests/TakeNthBytes.mjs"; import "./tests/Template.mjs"; import "./tests/TextEncodingBruteForce.mjs"; +import "./tests/TextIntegerConverter.mjs"; import "./tests/ToFromInsensitiveRegex.mjs"; import "./tests/TranslateDateTimeFormat.mjs"; import "./tests/Typex.mjs"; diff --git a/tests/operations/tests/TextIntegerConverter.mjs b/tests/operations/tests/TextIntegerConverter.mjs new file mode 100644 index 00000000..fed8f6c3 --- /dev/null +++ b/tests/operations/tests/TextIntegerConverter.mjs @@ -0,0 +1,199 @@ +/** + * Text-Integer Conversion tests. + * + * @author p-leriche [philip.leriche@cantab.net] + * + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ +import TestRegister from "../../lib/TestRegister.mjs"; + +TestRegister.addTests([ + { + name: "Text-Integer Conversion quoted string to decimal", + input: "\"ABC\"", + expectedOutput: "4276803", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Decimal"], + }, + ], + }, + { + name: "Text-Integer Conversion quoted string to hexadecimal", + input: "\"ABC\"", + expectedOutput: "0x414243", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Hexadecimal"], + }, + ], + }, + { + name: "Text-Integer Conversion single quoted string to decimal", + input: "'Hello'", + expectedOutput: "310939249775", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Decimal"], + }, + ], + }, + { + name: "Text-Integer Conversion decimal to string", + input: "4276803", + expectedOutput: "ABC", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["String"], + }, + ], + }, + { + name: "Text-Integer Conversion hexadecimal to string", + input: "0x48656C6C6F", + expectedOutput: "Hello", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["String"], + }, + ], + }, + { + name: "Text-Integer Conversion round-trip string.decimal.string", + input: "\"Test\"", + expectedOutput: "Test", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Decimal"], + }, + { + op: "Text-Integer Conversion", + args: ["String"], + }, + ], + }, + { + name: "Text-Integer Conversion round-trip string.hex.string", + input: "\"CyberChef\"", + expectedOutput: "CyberChef", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Hexadecimal"], + }, + { + op: "Text-Integer Conversion", + args: ["String"], + }, + ], + }, + { + name: "Text-Integer Conversion implicit round trip string-string Latin-1", + input: "U+00FF", + expectedOutput: "U+00FF", // U+00FF (Latin small letter y with diaeresis) + recipeConfig: [ + { + op: "Unescape Unicode Characters", + args: ["U+"], + }, + { + op: "Text-Integer Conversion", + args: ["String"], + }, + { + op: "Escape Unicode Characters", + args: ["U+", false, 4, true], + }, + ], + }, + { + name: "Text-Integer Conversion unquoted text to decimal", + input: "Hi", + expectedOutput: "18537", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Decimal"], + }, + ], + }, + { + name: "Text-Integer Conversion single character", + input: "\"A\"", + expectedOutput: "65", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Decimal"], + }, + ], + }, + { + name: "Text-Integer Conversion hex to decimal conversion", + input: "0xFF", + expectedOutput: "255", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Decimal"], + }, + ], + }, + { + name: "Text-Integer Conversion decimal to hex conversion", + input: "255", + expectedOutput: "0xff", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Hexadecimal"], + }, + ], + }, + { + name: "Text-Integer Conversion large number to string", + input: "113091951015816448506195587157728348242683688608116", + expectedOutput: "Mary had a little cat", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["String"], + }, + ], + }, + { + name: "Text-Integer Conversion whitespace handling (quoted)", + input: "\" test \"", + expectedOutput: "2314978187545944096", + recipeConfig: [ + { + op: "Text-Integer Conversion", + args: ["Decimal"], + }, + ], + }, + { + name: "Text-Integer Conversion non-Latin1 character in input", + input: "61 ce 93 61", + expectedOutput: +`Character at position 1 exceeds Latin-1 range (0-255). +Only ASCII and Latin-1 characters are supported.`, + recipeConfig: [ + { + "op": "From Hex", + "args": ["Auto"] + }, + { + op: "Text-Integer Conversion", + args: ["Decimal"], + }, + ], + }, +]); From a19261d5f745bc293da4a9204fdc37ee62fc59fc Mon Sep 17 00:00:00 2001 From: Thomas M <44269971+thomasxm@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:07:46 +0000 Subject: [PATCH 006/208] feat: add ARM disassembler operation (#2156) --- package-lock.json | 885 +++++++++++----------- package.json | 1 + src/core/config/Categories.json | 1 + src/core/operations/DisassembleARM.mjs | 193 +++++ tests/operations/index.mjs | 1 + tests/operations/tests/DisassembleARM.mjs | 377 +++++++++ 6 files changed, 1025 insertions(+), 433 deletions(-) create mode 100644 src/core/operations/DisassembleARM.mjs create mode 100644 tests/operations/tests/DisassembleARM.mjs diff --git a/package-lock.json b/package-lock.json index ab3f3bbf..6ab7c7fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { + "@alexaltea/capstone-js": "^3.0.5", "@astronautlabs/amf": "^0.0.6", "@blu3r4y/lzma": "^2.3.3", "@wavesenterprise/crypto-gost-js": "^2.1.0-RC1", @@ -161,6 +162,26 @@ "worker-loader": "^3.0.8" } }, + "node_modules/@alexaltea/capstone-js": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@alexaltea/capstone-js/-/capstone-js-3.0.5.tgz", + "integrity": "sha512-HWa4d5vblYc3OEJ9MpcXFo0gV/oDLTI5iH7ng80Gs3/Wo3lcYvB14gDDwSr9So1F+fuwIET8meo6TxTezEyqTg==" + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@asamuzakjp/css-color": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-2.8.3.tgz", @@ -236,23 +257,23 @@ } }, "node_modules/@babel/core": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", - "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", + "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@babel/code-frame": "^7.29.0", - "@babel/generator": "^7.29.0", - "@babel/helper-compilation-targets": "^7.28.6", - "@babel/helper-module-transforms": "^7.28.6", - "@babel/helpers": "^7.28.6", - "@babel/parser": "^7.29.0", - "@babel/template": "^7.28.6", - "@babel/traverse": "^7.29.0", - "@babel/types": "^7.29.0", - "@jridgewell/remapping": "^2.3.5", + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.0", + "@babel/generator": "^7.26.0", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.0", + "@babel/parser": "^7.26.0", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.26.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -374,9 +395,9 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.6.tgz", - "integrity": "sha512-mOAsxeeKkUKayvZR3HeTYD/fICpCPLJrU5ZjelT/PA6WHtNDBOE436YiaEUvHN454bRM3CebhDsIpieCc4texA==", + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.7.tgz", + "integrity": "sha512-6Fqi8MtQ/PweQ9xvux65emkLQ83uB+qAVtfHkC9UodyHMIZdxNI01HjLCLUtybElp2KY2XNE0nOgyP1E1vXw9w==", "dev": true, "license": "MIT", "dependencies": { @@ -565,15 +586,15 @@ } }, "node_modules/@babel/helpers": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz", - "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", + "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@babel/template": "^7.28.6", - "@babel/types": "^7.28.6" + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.0" }, "engines": { "node": ">=6.9.0" @@ -1704,13 +1725,13 @@ } }, "node_modules/@babel/preset-env/node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.14.0.tgz", - "integrity": "sha512-AvDcMxJ34W4Wgy4KBIIePQTAOP1Ie2WFwkQp3dB7FQ/f0lI5+nM96zUnYEOE1P9sEg0es5VCP0HxiWu5fUHZAQ==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.14.1.tgz", + "integrity": "sha512-ENp89vM9Pw4kv/koBb5N2f9bDZsR0hpf3BdPMOg/pkS3pwO4dzNnQZVXtBbeyAadgm865DmQG2jMMLqmZXvuCw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.6", + "@babel/helper-define-polyfill-provider": "^0.6.7", "core-js-compat": "^3.48.0" }, "peerDependencies": { @@ -1832,9 +1853,9 @@ } }, "node_modules/@codemirror/language": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.12.1.tgz", - "integrity": "sha512-Fa6xkSiuGKc8XC8Cn96T+TQHYj4ZZ7RdFmXA3i9xe/3hLHfwPZdM+dqfX0Cp0zQklBKhVD8Yzc8LS45rkqcwpQ==", + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.12.2.tgz", + "integrity": "sha512-jEPmz2nGGDxhRTg3lTpzmIyGKxz3Gp3SJES4b0nAuE5SWQoKdT5GoQ69cwMmFd+wvFUhYirtDTr0/DRHpQAyWg==", "dev": true, "license": "MIT", "dependencies": { @@ -1869,9 +1890,9 @@ } }, "node_modules/@codemirror/view": { - "version": "6.39.15", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.39.15.tgz", - "integrity": "sha512-aCWjgweIIXLBHh7bY6cACvXuyrZ0xGafjQ2VInjp4RM4gMfscK5uESiNdrH0pE+e1lZr2B4ONGsjchl2KsKZzg==", + "version": "6.39.16", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.39.16.tgz", + "integrity": "sha512-m6S22fFpKtOWhq8HuhzsI1WzUP/hB9THbDj0Tl5KX4gbO6Y91hwBl7Yky33NdvB6IffuRFiBxf1R8kJMyXmA4Q==", "dev": true, "license": "MIT", "dependencies": { @@ -2077,9 +2098,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-css": { - "version": "4.0.19", - "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.19.tgz", - "integrity": "sha512-VYHtPnZt/Zd/ATbW3rtexWpBnHUohUrQOHff/2JBhsVgxOrksAxJnLAO43Q1ayLJBJUUwNVo+RU0sx0aaysZfg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.1.0.tgz", + "integrity": "sha512-bfuvlTeGoK5QgXzzjn+PvqXU5J6mwraIdESNDSvPyplr/EbGFSuvgW3TOuoVNqW4WdDI7eM4tmoP5Dn1ZVgLag==", "dev": true, "license": "MIT" }, @@ -2126,9 +2147,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.29", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.29.tgz", - "integrity": "sha512-G3B27++9ziRdgbrY/G/QZdFAnMzzx17u8nCb2Xyd4q6luLpzViRM/CW3jA+Mb/cGT5zR/9N+Yz9SrGu1s0bq7g==", + "version": "4.4.30", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.30.tgz", + "integrity": "sha512-+eVO/VNw8IzQpDIL/SCj+ytd5WbzbHZdU+GAM8eUY2ZU1KTxRw6BoDO+hEFB4cGkD9x+BXm0OKVGSWHNCSGdVw==", "dev": true, "license": "MIT" }, @@ -2147,9 +2168,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.15.tgz", - "integrity": "sha512-uDMeqYlLlK476w/muEFQGBy9BdQWS0mQ7BJiy/iQv5XUWZxE2O54ZQd9nW8GyQMzAgoyg5SG4hf9l039Qt66oA==", + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.16.tgz", + "integrity": "sha512-SyrtuK2/sx+cr94jOp2/uOAb43ngZEVISUTRj4SR6SfoGULVV1iJS7Drqn7Ul9HJ731QDttwWlOUgcQ+yMRblg==", "dev": true, "license": "MIT" }, @@ -2287,13 +2308,13 @@ "license": "MIT" }, "node_modules/@cspell/dict-markdown": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.14.tgz", - "integrity": "sha512-uLKPNJsUcumMQTsZZgAK9RgDLyQhUz/uvbQTEkvF/Q4XfC1i/BnA8XrOrd0+Vp6+tPOKyA+omI5LRWfMu5K/Lw==", + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.15.tgz", + "integrity": "sha512-xz3LJfFCIJaxHu5Msu9UUSev1R1urVkERb5h1Yc5lJyNOkk/SQTSlNyME0Oma1sXlp6dLnIekL8GyeXJYszQ2w==", "dev": true, "license": "MIT", "peerDependencies": { - "@cspell/dict-css": "^4.0.19", + "@cspell/dict-css": "^4.1.0", "@cspell/dict-html": "^4.0.14", "@cspell/dict-html-symbol-entities": "^4.0.5", "@cspell/dict-typescript": "^3.2.3" @@ -2314,9 +2335,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.34", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.34.tgz", - "integrity": "sha512-M2MtfmYeHIPBuC8esMU4JQXHKma7Xt7VyBWUk67B62KDu61sxebQ2HeizdqmN2sLEJsTkq3bZT5PGzHpZ0LEWQ==", + "version": "5.2.36", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.36.tgz", + "integrity": "sha512-QeoanpVt8QrSxDQVseXn+qk4sy79TAkbgB0G7q3klsZAByr61gXd1yDQ/0wp8xXsyPx+M/BIj5Qd6B8GnozFLA==", "dev": true, "license": "MIT" }, @@ -2335,9 +2356,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-public-licenses": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.15.tgz", - "integrity": "sha512-cJEOs901H13Pfy0fl4dCD1U+xpWIMaEPq8MeYU83FfDZvellAuSo4GqWCripfIqlhns/L6+UZEIJSOZnjgy7Wg==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.16.tgz", + "integrity": "sha512-EQRrPvEOmwhwWezV+W7LjXbIBjiy6y/shrET6Qcpnk3XANTzfvWflf9PnJ5kId/oKWvihFy0za0AV1JHd03pSQ==", "dev": true, "license": "MIT" }, @@ -2387,9 +2408,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.21", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.21.tgz", - "integrity": "sha512-3lAB4OXsf6rs5zbwe4/nKmwyAJAvjs5KTRrPckzHx7q9dYpviW+UxDyhevCCsRfmcu24OhYP7BVQWXxLvYk4xA==", + "version": "5.1.24", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.24.tgz", + "integrity": "sha512-Y+5b5mw8lnovcoyuiVJJX5PpNPMbdpNyILR4wJDsUMWPK2ZVcl0yyG2UYJmevY7jq/+LY48Ai9RSp0ARAlDzEQ==", "dev": true, "license": "MIT" }, @@ -2654,9 +2675,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "license": "MIT", "engines": { @@ -2664,20 +2685,33 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", - "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", "dev": true, "license": "Apache-2.0", "dependencies": { "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", - "minimatch": "^3.1.2" + "minimatch": "^3.1.5" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/config-helpers": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", @@ -2705,9 +2739,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.4.tgz", - "integrity": "sha512-4h4MVF8pmBsncB60r0wSJiIeUKTSD4m7FmTFThG8RHlsg9ajqckLm9OraguFGZE4vVdpiI1Q4+hFnisopmG6gQ==", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", "dev": true, "license": "MIT", "dependencies": { @@ -2718,7 +2752,7 @@ "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.1", - "minimatch": "^3.1.3", + "minimatch": "^3.1.5", "strip-json-comments": "^3.1.1" }, "engines": { @@ -2742,9 +2776,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.3.tgz", - "integrity": "sha512-M2GCs7Vk83NxkUyQV1bkABc4yxgz9kILhHImZiBPAZ9ybuvCb0/H7lEl5XvIg3g+9d4eNotkZA5IWwYl0tibaA==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -2755,9 +2789,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.39.3", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.3.tgz", - "integrity": "sha512-1B1VkCq6FuUNlQvlBYb+1jDu/gV297TIs/OeiaSR9l1H27SVW55ONE1e1Vp16NqP683+xEGzxYtv4XCiDPaQiw==", + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", "dev": true, "license": "MIT", "engines": { @@ -3395,18 +3429,6 @@ "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -4652,9 +4674,9 @@ } }, "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "license": "MIT", "dependencies": { @@ -4998,9 +5020,9 @@ } }, "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", - "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", "license": "MIT" }, "node_modules/assert": { @@ -5067,9 +5089,9 @@ "license": "MIT" }, "node_modules/autoprefixer": { - "version": "10.4.24", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.24.tgz", - "integrity": "sha512-uHZg7N9ULTVbutaIsDRoUkoS8/h3bdsmVJYZ5l3wv8Cp/6UIIoRDm90hZ+BwxUj/hGBEzLxdHNSKuFpn8WOyZw==", + "version": "10.4.27", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.27.tgz", + "integrity": "sha512-NP9APE+tO+LuJGn7/9+cohklunJsXWiaWEfV3si4Gi/XHDwVNgkwr1J3RQYFIvPy76GmJ9/bW8vyoU1LcxwKHA==", "dev": true, "funding": [ { @@ -5088,7 +5110,7 @@ "license": "MIT", "dependencies": { "browserslist": "^4.28.1", - "caniuse-lite": "^1.0.30001766", + "caniuse-lite": "^1.0.30001774", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" @@ -5147,21 +5169,21 @@ } }, "node_modules/axios": { - "version": "1.13.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.5.tgz", - "integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==", + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", "dev": true, "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.11", - "form-data": "^4.0.5", + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "node_modules/babel-loader": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-10.0.0.tgz", - "integrity": "sha512-z8jt+EdS61AMw22nSfoNJAZ0vrtmhPRVi6ghL3rCeRZI8cdNYFiV5xeV3HbE7rlZZNmGH8BVccwWt8/ED0QOHA==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-10.1.0.tgz", + "integrity": "sha512-5HTUZa013O4SWEYlJDHexrqSIYkWatfA9w/ZZQa7V2nMc0dRWkfu/0pmioC7XMYm8M7Z/3+q42NWj6e+fAT0MQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5171,19 +5193,28 @@ "node": "^18.20.0 || ^20.10.0 || >=22.0.0" }, "peerDependencies": { - "@babel/core": "^7.12.0", + "@babel/core": "^7.12.0 || ^8.0.0-beta.1", + "@rspack/core": "^1.0.0 || ^2.0.0-0", "webpack": ">=5.61.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.4.15", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.15.tgz", - "integrity": "sha512-hR3GwrRwHUfYwGfrisXPIDP3JcYfBrW7wKE7+Au6wDYl7fm/ka1NEII6kORzxNU556JjfidZeBsO10kYvtV1aw==", + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.16.tgz", + "integrity": "sha512-xaVwwSfebXf0ooE11BJovZYKhFjIvQo7TsyVpETuIeH2JHv0k/T6Y5j22pPTvqYqmpkxdlPAJlyJ0tfOJAoMxw==", "dev": true, "license": "MIT", "dependencies": { "@babel/compat-data": "^7.28.6", - "@babel/helper-define-polyfill-provider": "^0.6.6", + "@babel/helper-define-polyfill-provider": "^0.6.7", "semver": "^6.3.1" }, "peerDependencies": { @@ -5205,13 +5236,13 @@ } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.6.tgz", - "integrity": "sha512-hYm+XLYRMvupxiQzrvXUj7YyvFFVfv5gI0R71AJzudg1g2AI2vyCPPIFEBjk162/wFzti3inBHo7isWFuEVS/A==", + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.7.tgz", + "integrity": "sha512-OTYbUlSwXhNgr4g6efMZgsO8//jA61P7ZbRX3iTT53VON8l+WQS8IAUEVo4a4cWknrg2W8Cj4gQhRYNCJ8GkAA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.6" + "@babel/helper-define-polyfill-provider": "^0.6.7" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" @@ -5285,9 +5316,9 @@ "license": "MIT" }, "node_modules/basic-ftp": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.0.tgz", - "integrity": "sha512-VoMINM2rqJwJgfdHq6RiUudKt2BV+FY5ZFezP/ypmwayk68+NzzAQy4XXLlqsGD4MCzq3DrmNFD/uUmBJuGoXw==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", "dev": true, "license": "MIT", "engines": { @@ -5416,9 +5447,9 @@ "license": "BSD-3-Clause" }, "node_modules/bn.js": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.3.tgz", - "integrity": "sha512-EAcmnPkxpntVL+DS7bO1zhcZNvCkxqtkd0ZY53h06GNQ3DEkkGZ/gKgmDv6DdZQGj9BgfSPKtJJ7Dp1GPP8f7w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", "license": "MIT" }, "node_modules/body": { @@ -5434,24 +5465,24 @@ } }, "node_modules/body-parser": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", - "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "license": "MIT", "dependencies": { - "bytes": "~3.1.2", + "bytes": "3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", - "destroy": "~1.2.0", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "on-finished": "~2.4.1", - "qs": "~6.14.0", - "raw-body": "~2.5.3", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", "type-is": "~1.6.18", - "unpipe": "~1.0.0" + "unpipe": "1.0.0" }, "engines": { "node": ">= 0.8", @@ -5479,24 +5510,20 @@ } }, "node_modules/body-parser/node_modules/http-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", - "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "license": "MIT", "dependencies": { - "depd": "~2.0.0", - "inherits": "~2.0.4", - "setprototypeof": "~1.2.0", - "statuses": "~2.0.2", - "toidentifier": "~1.0.1" + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" }, "engines": { "node": ">= 0.8" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" } }, "node_modules/body-parser/node_modules/iconv-lite": { @@ -5533,13 +5560,13 @@ } }, "node_modules/body-parser/node_modules/qs": { - "version": "6.14.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", - "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.1.0" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -5549,16 +5576,16 @@ } }, "node_modules/body-parser/node_modules/raw-body": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", - "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dev": true, "license": "MIT", "dependencies": { - "bytes": "~3.1.2", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "unpipe": "~1.0.0" + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" }, "engines": { "node": ">= 0.8" @@ -5572,9 +5599,9 @@ "license": "ISC" }, "node_modules/body-parser/node_modules/statuses": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", - "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, "license": "MIT", "engines": { @@ -5707,9 +5734,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "license": "MIT", "dependencies": { @@ -5795,23 +5822,24 @@ } }, "node_modules/browserify-sign": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.5.tgz", - "integrity": "sha512-C2AUdAJg6rlM2W5QMp2Q4KGQMVBwR1lIimTsUnutJ8bMpW5B52pGpR2gEnNBNwijumDo5FojQ0L9JrXA8m4YEw==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", "license": "ISC", "dependencies": { - "bn.js": "^5.2.2", - "browserify-rsa": "^4.1.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.6.1", + "elliptic": "^6.5.5", + "hash-base": "~3.0", "inherits": "^2.0.4", - "parse-asn1": "^5.1.9", + "parse-asn1": "^5.1.7", "readable-stream": "^2.3.8", "safe-buffer": "^5.2.1" }, "engines": { - "node": ">= 0.10" + "node": ">= 0.12" } }, "node_modules/browserify-zlib": { @@ -6056,9 +6084,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001769", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz", - "integrity": "sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==", + "version": "1.0.30001777", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001777.tgz", + "integrity": "sha512-tmN+fJxroPndC74efCdp12j+0rk0RHwV5Jwa1zWaFVyw2ZxAuPeG8ZgWC3Wz7uSjT3qMRQ5XHZ4COgQmsCMJAQ==", "dev": true, "funding": [ { @@ -6492,14 +6520,13 @@ } }, "node_modules/comment-json": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.5.1.tgz", - "integrity": "sha512-taEtr3ozUmOB7it68Jll7s0Pwm+aoiHyXKrEC8SEodL4rNpdfDLqa7PfBlrgFoCNNdR8ImL+muti5IGvktJAAg==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.6.2.tgz", + "integrity": "sha512-R2rze/hDX30uul4NZoIZ76ImSJLFxn/1/ZxtKC1L77y2X1k+yYu1joKbAtMA2Fg3hZrTOiw0I5mwVMo0cf250w==", "dev": true, "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", - "core-util-is": "^1.0.3", "esprima": "^4.0.1" }, "engines": { @@ -6568,9 +6595,9 @@ } }, "node_modules/compression": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.1.tgz", - "integrity": "sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.5.tgz", + "integrity": "sha512-bQJ0YRck5ak3LgtnpKkiabX5pNF7tMUh1BSy2ZBOTh0Dim0BUu6aPPwByIns6/A5Prh8PufSPerMDUklpzes2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -6578,7 +6605,7 @@ "compressible": "~2.0.18", "debug": "2.6.9", "negotiator": "~0.6.4", - "on-headers": "~1.1.0", + "on-headers": "~1.0.2", "safe-buffer": "5.2.1", "vary": "~1.1.2" }, @@ -6905,9 +6932,9 @@ } }, "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", - "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", "license": "MIT" }, "node_modules/create-hash": { @@ -8157,15 +8184,16 @@ } }, "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", - "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", "license": "MIT" }, "node_modules/discontinuous-range": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", - "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==" + "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==", + "license": "MIT" }, "node_modules/dns-packet": { "version": "5.6.1", @@ -8245,10 +8273,13 @@ } }, "node_modules/dompurify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.1.tgz", - "integrity": "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.2.tgz", + "integrity": "sha512-6obghkliLdmKa56xdbLOpUZ43pAR6xFy1uOrxBaIDjT+yaRuuybLjGS9eVBoSR/UPU5fq3OXClEHLJNGvbxKpQ==", "license": "(MPL-2.0 OR Apache-2.0)", + "engines": { + "node": ">=20" + }, "optionalDependencies": { "@types/trusted-types": "^2.0.7" } @@ -8366,9 +8397,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.302", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.302.tgz", - "integrity": "sha512-sM6HAN2LyK82IyPBpznDRqlTQAtuSaO+ShzFiWTvoMJLHyZ+Y39r8VMfHzwbU8MVBzQ4Wdn85+wlZl2TLGIlwg==", + "version": "1.5.307", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.307.tgz", + "integrity": "sha512-5z3uFKBWjiNR44nFcYdkcXjKMbg5KXNdciu7mhTPo9tB7NbqSNP2sSnGR+fqknZSCwKkBN+oxiiajWs4dT6ORg==", "dev": true, "license": "ISC" }, @@ -8388,9 +8419,9 @@ } }, "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", - "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", "license": "MIT" }, "node_modules/emoji-regex": { @@ -8431,9 +8462,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.19.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz", - "integrity": "sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==", + "version": "5.20.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.20.0.tgz", + "integrity": "sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8544,6 +8575,13 @@ "dev": true, "license": "MIT" }, + "node_modules/es-module-lexer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", + "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", @@ -8556,22 +8594,6 @@ "node": ">= 0.4" } }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/es6-object-assign": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", @@ -8653,25 +8675,25 @@ } }, "node_modules/eslint": { - "version": "9.39.3", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.3.tgz", - "integrity": "sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==", + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.1", + "@eslint/config-array": "^0.21.2", "@eslint/config-helpers": "^0.4.2", "@eslint/core": "^0.17.0", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.39.3", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", - "ajv": "^6.12.4", + "ajv": "^6.14.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", @@ -8690,7 +8712,7 @@ "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", + "minimatch": "^3.1.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, @@ -8873,6 +8895,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -8931,9 +8966,9 @@ } }, "node_modules/esquery": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", - "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -9091,40 +9126,40 @@ } }, "node_modules/express": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", - "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dev": true, "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "~1.20.3", - "content-disposition": "~0.5.4", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "~0.7.1", - "cookie-signature": "~1.0.6", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "~1.3.1", - "fresh": "~0.5.2", - "http-errors": "~2.0.0", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", "merge-descriptors": "1.0.3", "methods": "~1.1.2", - "on-finished": "~2.4.1", + "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "~0.1.12", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", - "qs": "~6.14.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "~0.19.0", - "serve-static": "~1.16.2", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", - "statuses": "~2.0.1", + "statuses": "2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" @@ -9214,13 +9249,13 @@ } }, "node_modules/express/node_modules/qs": { - "version": "6.14.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", - "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.1.0" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -9418,9 +9453,9 @@ } }, "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "license": "MIT", "dependencies": { @@ -9583,9 +9618,9 @@ "license": "ISC" }, "node_modules/follow-redirects": { - "version": "1.15.11", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", - "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "dev": true, "funding": [ { @@ -9666,16 +9701,14 @@ } }, "node_modules/form-data": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", - "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { @@ -10520,9 +10553,9 @@ } }, "node_modules/grunt/node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "license": "MIT", "dependencies": { @@ -10791,9 +10824,9 @@ } }, "node_modules/html-entities": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz", - "integrity": "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", "dev": true, "funding": [ { @@ -10986,9 +11019,9 @@ } }, "node_modules/http-proxy-middleware": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.9.tgz", - "integrity": "sha512-c1IyJYLYppU574+YI7R4QyX2ystMtVXZwIdzazUIPIJsHuWNd+mho2j+bKoHftndicGj9yh+xjd+l0yj7VeT1Q==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", + "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", "dev": true, "license": "MIT", "dependencies": { @@ -11958,15 +11991,16 @@ } }, "node_modules/jake": { - "version": "10.9.4", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", - "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", + "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "async": "^3.2.6", + "async": "^3.2.3", + "chalk": "^4.0.2", "filelist": "^1.0.4", - "picocolors": "^1.1.1" + "minimatch": "^3.1.2" }, "bin": { "jake": "bin/cli.js" @@ -11975,6 +12009,52 @@ "node": ">=10" } }, + "node_modules/jake/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jake/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jake/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -12301,23 +12381,23 @@ } }, "node_modules/jwa": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", - "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "license": "MIT", "dependencies": { - "buffer-equal-constant-time": "^1.0.1", + "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "node_modules/jws": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz", - "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "license": "MIT", "dependencies": { - "jwa": "^1.4.2", + "jwa": "^1.4.1", "safe-buffer": "^5.0.1" } }, @@ -12912,9 +12992,9 @@ } }, "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", - "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", "license": "MIT" }, "node_modules/mime": { @@ -13109,9 +13189,9 @@ } }, "node_modules/mocha/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, "license": "ISC", "dependencies": { @@ -13173,9 +13253,10 @@ } }, "node_modules/moo": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", - "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==" + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.3.tgz", + "integrity": "sha512-m2fmM2dDm7GZQsY7KK2cme8agi+AAljILjQnof7p1ZMDe6dQ4bdnSMx0cPppudoeNv5hEFQirN6u+O4fDE0IWA==", + "license": "BSD-3-Clause" }, "node_modules/more-entropy": { "version": "0.0.7", @@ -13186,9 +13267,9 @@ } }, "node_modules/morgan": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.1.tgz", - "integrity": "sha512-223dMRJtI/l25dJKWpgij2cMtywuG/WiUKXdvwfbhGKBhy1puASqXwFzmWZ7+K73vUPoR7SS2Qz2cI/g9MKw0A==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13196,7 +13277,7 @@ "debug": "2.6.9", "depd": "~2.0.0", "on-finished": "~2.3.0", - "on-headers": "~1.1.0" + "on-headers": "~1.0.2" }, "engines": { "node": ">= 0.8.0" @@ -13286,6 +13367,7 @@ "version": "2.20.1", "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz", "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", + "license": "MIT", "dependencies": { "commander": "^2.19.0", "moo": "^0.5.0", @@ -13306,7 +13388,8 @@ "node_modules/nearley/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" }, "node_modules/negotiator": { "version": "0.6.3", @@ -13628,9 +13711,9 @@ "license": "CC0-1.0" }, "node_modules/node-releases": { - "version": "2.0.27", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", - "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz", + "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==", "dev": true, "license": "MIT" }, @@ -13862,9 +13945,9 @@ } }, "node_modules/on-headers": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", - "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true, "license": "MIT", "engines": { @@ -14226,15 +14309,16 @@ } }, "node_modules/parse-asn1": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.9.tgz", - "integrity": "sha512-fIYNuZ/HastSb80baGOuPRo1O9cf4baWw5WsAp7dBuUzeTD/BoaG8sVTdlPFksBE2lF21dN+A1AnrpIjSWqHHg==", + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", "license": "ISC", "dependencies": { "asn1.js": "^4.10.1", "browserify-aes": "^1.2.0", "evp_bytestokey": "^1.0.3", - "pbkdf2": "^3.1.5", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", "safe-buffer": "^5.2.1" }, "engines": { @@ -14470,20 +14554,19 @@ } }, "node_modules/pbkdf2": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.5.tgz", - "integrity": "sha512-Q3CG/cYvCO1ye4QKkuH7EXxs3VC/rI1/trd+qX2+PolbaKG0H+bgcZzrTt96mMyRtejk+JMCiLUn3y29W8qmFQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "license": "MIT", "dependencies": { - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "ripemd160": "^2.0.3", - "safe-buffer": "^5.2.1", - "sha.js": "^2.4.12", - "to-buffer": "^1.2.1" + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" }, "engines": { - "node": ">= 0.10" + "node": ">=0.12" } }, "node_modules/peek-readable": { @@ -14631,9 +14714,9 @@ } }, "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "version": "8.5.8", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", + "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==", "dev": true, "funding": [ { @@ -15002,9 +15085,9 @@ } }, "node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.12.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", - "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", "license": "MIT" }, "node_modules/pump": { @@ -15075,9 +15158,9 @@ "license": "MIT" }, "node_modules/qs": { - "version": "6.15.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", - "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.1.0" @@ -15112,12 +15195,14 @@ "node_modules/railroad-diagrams": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", - "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==" + "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==", + "license": "CC0-1.0" }, "node_modules/randexp": { "version": "0.4.6", "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz", "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", + "license": "MIT", "dependencies": { "discontinuous-range": "1.0.0", "ret": "~0.1.10" @@ -15272,9 +15357,9 @@ } }, "node_modules/readdir-glob/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "license": "MIT", "dependencies": { @@ -15554,6 +15639,7 @@ "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "license": "MIT", "engines": { "node": ">=0.12" } @@ -15593,31 +15679,13 @@ } }, "node_modules/ripemd160": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.3.tgz", - "integrity": "sha512-5Di9UC0+8h1L6ZD2d7awM7E/T4uA1fJRlx6zk/NvdCCVEoAnFqvHmCuNeIKoCeIixBX/q8uM+6ycDvF8woqosA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "license": "MIT", "dependencies": { - "hash-base": "^3.1.2", - "inherits": "^2.0.4" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ripemd160/node_modules/hash-base": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.2.tgz", - "integrity": "sha512-Bb33KbowVTIj5s7Ked1OsqHUeCpz//tPwR+E2zJgJKo9Z5XolZ9b6bdUgjmYlwnWhoOQKoTd1TYToZGn5mAYOg==", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^2.3.8", - "safe-buffer": "^5.2.1", - "to-buffer": "^1.2.1" - }, - "engines": { - "node": ">= 0.8" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" } }, "node_modules/rison": { @@ -15747,9 +15815,9 @@ } }, "node_modules/schema-utils/node_modules/ajv": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "license": "MIT", "dependencies": { @@ -16054,23 +16122,16 @@ "license": "ISC" }, "node_modules/sha.js": { - "version": "2.4.12", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz", - "integrity": "sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==", + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "license": "(MIT AND BSD-3-Clause)", "dependencies": { - "inherits": "^2.0.4", - "safe-buffer": "^5.2.1", - "to-buffer": "^1.2.0" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" }, "bin": { "sha.js": "bin.js" - }, - "engines": { - "node": ">= 0.10" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, "node_modules/shebang-command": { @@ -16202,12 +16263,12 @@ "license": "ISC" }, "node_modules/simple-xml-to-json": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/simple-xml-to-json/-/simple-xml-to-json-1.2.2.tgz", - "integrity": "sha512-bmJJf5YiYL60eOQk3gaVxbM6vgYuwrFydCEAA2x3jccHUTsAffiPyblS/yQGr8GDUQVxSDm3WwLNL5HmRqDUcg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/simple-xml-to-json/-/simple-xml-to-json-1.2.3.tgz", + "integrity": "sha512-kWJDCr9EWtZ+/EYYM5MareWj2cRnZGF93YDNpH4jQiHB+hBIZnfPFSQiVMzZOdk+zXWqTZ/9fTeQNu2DqeiudA==", "license": "MIT", "engines": { - "node": ">=14.20.0" + "node": ">=20.12.2" } }, "node_modules/sirv": { @@ -16226,9 +16287,9 @@ } }, "node_modules/sitemap": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-8.0.2.tgz", - "integrity": "sha512-LwktpJcyZDoa0IL6KT++lQ53pbSrx2c9ge41/SeLTyqy2XUNA6uR4+P9u5IVo5lPeL2arAcOKn1aZAxoYbCKlQ==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-8.0.3.tgz", + "integrity": "sha512-9Ew1tR2WYw8RGE2XLy7GjkusvYXy8Rg6y8TYuBuQMfIEdGcWoJpY2Wr5DzsEiL/TKCw56+YKTCCUHglorEYK+A==", "dev": true, "license": "MIT", "dependencies": { @@ -16465,9 +16526,10 @@ "license": "BSD-3-Clause" }, "node_modules/sql-formatter": { - "version": "15.6.5", - "resolved": "https://registry.npmjs.org/sql-formatter/-/sql-formatter-15.6.5.tgz", - "integrity": "sha512-fr4TyM1udCSrOHOmouotwUi8dxIDhSLpYNmPePGFVzxq8/i8jd828IapE49QXG7Gzkswxo5WwdAGnYX4YpKoTg==", + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/sql-formatter/-/sql-formatter-15.7.2.tgz", + "integrity": "sha512-b0BGoM81KFRVSpZFwPpIPU5gng4YD8DI/taLD96NXCFRf5af3FzSE4aSwjKmxcyTmf/MfPu91j75883nRrWDBw==", + "license": "MIT", "dependencies": { "argparse": "^2.0.1", "nearley": "^2.20.1" @@ -16893,16 +16955,15 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.16", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz", - "integrity": "sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==", + "version": "5.3.17", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.17.tgz", + "integrity": "sha512-YR7PtUp6GMU91BgSJmlaX/rS2lGDbAF7D+Wtq7hRO+MiljNmodYvqslzCFiYVAgW+Qoaaia/QUIP4lGXufjdZw==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "jest-worker": "^27.4.5", "schema-utils": "^4.3.0", - "serialize-javascript": "^6.0.2", "terser": "^5.31.1" }, "engines": { @@ -16953,9 +17014,9 @@ } }, "node_modules/tesseract.js-core": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/tesseract.js-core/-/tesseract.js-core-6.0.0.tgz", - "integrity": "sha512-1Qncm/9oKM7xgrQXZXNB+NRh19qiXGhxlrR8EwFbK5SaUbPZnS5OMtP/ghtqfd23hsr1ZvZbZjeuAGcMxd/ooA==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/tesseract.js-core/-/tesseract.js-core-6.1.2.tgz", + "integrity": "sha512-pv4GjmramjdObhDyR1q85Td8X60Puu/lGQn7Kw2id05LLgHhAcWgnz6xSdMCSxBMWjQDmMyDXPTC2aqADdpiow==", "license": "Apache-2.0" }, "node_modules/thingies": { @@ -17069,35 +17130,15 @@ } }, "node_modules/tmp": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", - "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "dev": true, "license": "MIT", "engines": { "node": ">=14.14" } }, - "node_modules/to-buffer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz", - "integrity": "sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==", - "license": "MIT", - "dependencies": { - "isarray": "^2.0.5", - "safe-buffer": "^5.2.1", - "typed-array-buffer": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/to-buffer/node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "license": "MIT" - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -17270,20 +17311,6 @@ "node": ">= 0.6" } }, - "node_modules/typed-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", - "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-typed-array": "^1.1.14" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/ua-parser-js": { "version": "1.0.41", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.41.tgz", @@ -17703,9 +17730,9 @@ } }, "node_modules/webpack": { - "version": "5.105.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.105.2.tgz", - "integrity": "sha512-dRXm0a2qcHPUBEzVk8uph0xWSjV/xZxenQQbLwnwP7caQCYpqG1qddwlyEkIDkYn0K8tvmcrZ+bOrzoQ3HxCDw==", + "version": "5.105.4", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.105.4.tgz", + "integrity": "sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==", "dev": true, "license": "MIT", "dependencies": { @@ -17715,11 +17742,11 @@ "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", - "acorn": "^8.15.0", + "acorn": "^8.16.0", "acorn-import-phases": "^1.0.3", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.19.0", + "enhanced-resolve": "^5.20.0", "es-module-lexer": "^2.0.0", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -17731,9 +17758,9 @@ "neo-async": "^2.6.2", "schema-utils": "^4.3.3", "tapable": "^2.3.0", - "terser-webpack-plugin": "^5.3.16", + "terser-webpack-plugin": "^5.3.17", "watchpack": "^2.5.1", - "webpack-sources": "^3.3.3" + "webpack-sources": "^3.3.4" }, "bin": { "webpack": "bin/webpack.js" @@ -17917,9 +17944,9 @@ } }, "node_modules/webpack-dev-server/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "license": "MIT", "dependencies": { @@ -17940,10 +17967,9 @@ } }, "node_modules/webpack-dev-server/node_modules/glob": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", - "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", - "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "license": "ISC", "dependencies": { @@ -18048,13 +18074,6 @@ "node": ">=10.13.0" } }, - "node_modules/webpack/node_modules/es-module-lexer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", - "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==", - "dev": true, - "license": "MIT" - }, "node_modules/websocket-driver": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", diff --git a/package.json b/package.json index 1602b1b6..d3519e0f 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ "worker-loader": "^3.0.8" }, "dependencies": { + "@alexaltea/capstone-js": "^3.0.5", "@astronautlabs/amf": "^0.0.6", "@blu3r4y/lzma": "^2.3.3", "@wavesenterprise/crypto-gost-js": "^2.1.0-RC1", diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index f03fb8ea..8b62046e 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -559,6 +559,7 @@ "Chi Square", "P-list Viewer", "Disassemble x86", + "Disassemble ARM", "Pseudo-Random Number Generator", "Pseudo-Random Integer Generator", "Generate De Bruijn Sequence", diff --git a/src/core/operations/DisassembleARM.mjs b/src/core/operations/DisassembleARM.mjs new file mode 100644 index 00000000..d8cb56da --- /dev/null +++ b/src/core/operations/DisassembleARM.mjs @@ -0,0 +1,193 @@ +/** + * @author MedjedThomasXM + * @copyright Crown Copyright 2024 + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import OperationError from "../errors/OperationError.mjs"; +import { isWorkerEnvironment } from "../Utils.mjs"; +import cs from "@alexaltea/capstone-js/dist/capstone.min.js"; + +/** + * Disassemble ARM operation + */ +class DisassembleARM extends Operation { + + /** + * DisassembleARM constructor + */ + constructor() { + super(); + + this.name = "Disassemble ARM"; + this.module = "Shellcode"; + this.description = "Disassembles ARM machine code into assembly language.

Supports ARM (32-bit), Thumb, and ARM64 (AArch64) architectures using the Capstone disassembly framework.

Input should be in hexadecimal."; + this.infoURL = "https://wikipedia.org/wiki/ARM_architecture_family"; + this.inputType = "string"; + this.outputType = "string"; + this.args = [ + { + "name": "Architecture", + "type": "option", + "value": ["ARM (32-bit)", "ARM64 (AArch64)"] + }, + { + "name": "Mode", + "type": "option", + "value": ["ARM", "Thumb", "Thumb + Cortex-M", "ARMv8"] + }, + { + "name": "Endianness", + "type": "option", + "value": ["Little Endian", "Big Endian"] + }, + { + "name": "Starting address (hex)", + "type": "number", + "value": 0 + }, + { + "name": "Show instruction hex", + "type": "boolean", + "value": true + }, + { + "name": "Show instruction position", + "type": "boolean", + "value": true + } + ]; + } + + /** + * @param {string} input + * @param {Object[]} args + * @returns {string} + */ + async run(input, args) { + const [ + architecture, + mode, + endianness, + startAddress, + showHex, + showPosition + ] = args; + + // Remove whitespace from input + const hexInput = input.replace(/\s/g, ""); + + // Validate hex input + if (!/^[0-9a-fA-F]*$/.test(hexInput)) { + throw new OperationError("Invalid hexadecimal input. Please provide valid hex characters only."); + } + + if (hexInput.length === 0) { + return ""; + } + + if (hexInput.length % 2 !== 0) { + throw new OperationError("Invalid hexadecimal input. Length must be even."); + } + + // Convert hex string to byte array + const bytes = []; + for (let i = 0; i < hexInput.length; i += 2) { + bytes.push(parseInt(hexInput.substr(i, 2), 16)); + } + + // Determine architecture constant + let arch; + if (architecture === "ARM64 (AArch64)") { + arch = cs.ARCH_ARM64; + } else { + arch = cs.ARCH_ARM; + } + + // Determine mode constant + let modeValue = cs.MODE_LITTLE_ENDIAN; + + if (architecture === "ARM (32-bit)") { + switch (mode) { + case "ARM": + modeValue = cs.MODE_ARM; + break; + case "Thumb": + modeValue = cs.MODE_THUMB; + break; + case "Thumb + Cortex-M": + modeValue = cs.MODE_THUMB | cs.MODE_MCLASS; + break; + case "ARMv8": + modeValue = cs.MODE_ARM | cs.MODE_V8; + break; + default: + modeValue = cs.MODE_ARM; + } + } else { + // ARM64 only has one mode (ARM mode is default for ARM64) + modeValue = cs.MODE_ARM; + } + + // Add endianness + if (endianness === "Big Endian") { + modeValue |= cs.MODE_BIG_ENDIAN; + } + + if (isWorkerEnvironment()) { + self.sendStatusMessage("Disassembling..."); + } + + let disassembler; + try { + disassembler = new cs.Capstone(arch, modeValue); + } catch (e) { + throw new OperationError(`Failed to initialise Capstone disassembler: ${e}`); + } + + let instructions; + try { + instructions = disassembler.disasm(bytes, startAddress); + } catch (e) { + disassembler.close(); + // Check if it's a "no valid instructions" error (code 0 means OK but nothing decoded) + if (e && e.includes && e.includes("code 0:")) { + throw new OperationError(`No valid ${architecture} instructions found in input. The bytes may be for a different architecture or mode.`); + } + throw new OperationError(`Disassembly failed: ${e}`); + } + + // Format output + const output = []; + for (const insn of instructions) { + let line = ""; + + if (showPosition) { + // Format address as hex with 0x prefix + const addrHex = "0x" + insn.address.toString(16).padStart(8, "0"); + line += addrHex + " "; + } + + if (showHex) { + // Format instruction bytes as hex + const bytesHex = insn.bytes.map(b => b.toString(16).padStart(2, "0")).join(""); + line += bytesHex.padEnd(16, " ") + " "; + } + + line += insn.mnemonic; + if (insn.op_str) { + line += " " + insn.op_str; + } + + output.push(line); + } + + disassembler.close(); + + return output.join("\n"); + } + +} + +export default DisassembleARM; diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 48ff4c8e..fb03a5f7 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -61,6 +61,7 @@ import "./tests/Crypt.mjs"; import "./tests/CSV.mjs"; import "./tests/DateTime.mjs"; import "./tests/DefangIP.mjs"; +import "./tests/DisassembleARM.mjs"; import "./tests/DropNthBytes.mjs"; import "./tests/ECDSA.mjs"; import "./tests/ELFInfo.mjs"; diff --git a/tests/operations/tests/DisassembleARM.mjs b/tests/operations/tests/DisassembleARM.mjs new file mode 100644 index 00000000..5306e9ce --- /dev/null +++ b/tests/operations/tests/DisassembleARM.mjs @@ -0,0 +1,377 @@ +/** + * Disassemble ARM tests. + * + * @author MedjedThomasXM + * + * @copyright Crown Copyright 2024 + * @license Apache-2.0 + */ +import TestRegister from "../../lib/TestRegister.mjs"; + +TestRegister.addTests([ + // ==================== ARM32 TESTS ==================== + { + name: "Disassemble ARM: ARM32 NOP (mov r0, r0)", + input: "00 00 a0 e1", + expectedMatch: /mov\s+r0,\s*r0/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM32 bx lr", + input: "1e ff 2f e1", + expectedMatch: /bx\s+lr/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM32 push {fp, lr}", + input: "00 48 2d e9", + expectedMatch: /push\s+\{fp,\s*lr\}/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM32 add fp, sp, #4", + input: "04 b0 8d e2", + expectedMatch: /add\s+fp,\s*sp/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM32 ldr r0, [r1]", + input: "00 00 91 e5", + expectedMatch: /ldr\s+r0,\s*\[r1\]/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM32 str r0, [r1]", + input: "00 00 81 e5", + expectedMatch: /str\s+r0,\s*\[r1\]/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM32 bl (branch link)", + input: "00 00 00 eb", + expectedMatch: /bl\s+/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM32 mul r0, r1, r2", + input: "91 02 00 e0", + expectedMatch: /mul\s+r0,\s*r1,\s*r2/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + + // ==================== ARM32 THUMB TESTS ==================== + { + name: "Disassemble ARM: Thumb mov r0, r0", + input: "00 46", + expectedMatch: /mov\s+r0,\s*r0/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "Thumb", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: Thumb bx lr", + input: "70 47", + expectedMatch: /bx\s+lr/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "Thumb", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: Thumb push {r4, lr}", + input: "10 b5", + expectedMatch: /push\s+\{r4,\s*lr\}/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "Thumb", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: Thumb pop {r4, pc}", + input: "10 bd", + expectedMatch: /pop\s+\{r4,\s*pc\}/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "Thumb", "Little Endian", 0, true, true], + }, + ], + }, + + // ==================== ARM64 TESTS ==================== + { + name: "Disassemble ARM: ARM64 ret", + input: "c0 03 5f d6", + expectedMatch: /ret/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 mov x0, #0", + input: "00 00 80 d2", + expectedMatch: /mov[z]?\s+x0,\s*#0/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 stp x29, x30, [sp, #-16]!", + input: "fd 7b bf a9", + expectedMatch: /stp\s+x29,\s*x30,\s*\[sp/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 ldp x29, x30, [sp], #16", + input: "fd 7b c1 a8", + expectedMatch: /ldp\s+x29,\s*x30,\s*\[sp\]/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 add x0, x1, x2", + input: "20 00 02 8b", + expectedMatch: /add\s+x0,\s*x1,\s*x2/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 sub x0, x1, x2", + input: "20 00 02 cb", + expectedMatch: /sub\s+x0,\s*x1,\s*x2/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 mul x0, x1, x2", + input: "20 7c 02 9b", + expectedMatch: /mul\s+x0,\s*x1,\s*x2/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 ldr x0, [x1]", + input: "20 00 40 f9", + expectedMatch: /ldr\s+x0,\s*\[x1\]/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 str x0, [x1]", + input: "20 00 00 f9", + expectedMatch: /str\s+x0,\s*\[x1\]/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 bl (branch link)", + input: "00 00 00 94", + expectedMatch: /bl\s+/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 cbz x0", + input: "00 00 00 b4", + expectedMatch: /cbz\s+x0/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 cbnz x0", + input: "00 00 00 b5", + expectedMatch: /cbnz\s+x0/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 sub sp, sp, #0x20", + input: "ff 83 00 d1", + expectedMatch: /sub\s+sp,\s*sp/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 add sp, sp, #0x20", + input: "ff 83 00 91", + expectedMatch: /add\s+sp,\s*sp/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + + // ==================== MULTI-INSTRUCTION TESTS ==================== + { + name: "Disassemble ARM: ARM32 multiple instructions", + input: "00 48 2d e9 04 b0 8d e2 00 00 a0 e1 00 88 bd e8", + expectedMatch: /push.*\n.*add.*\n.*mov.*\n.*pop/s, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM64 function prologue/epilogue", + input: "fd 7b bf a9 fd 03 00 91 00 00 80 52 fd 7b c1 a8 c0 03 5f d6", + expectedMatch: /stp.*\n.*mov.*\n.*mov.*\n.*ldp.*\n.*ret/s, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, + + // ==================== ADDRESS TESTS ==================== + { + name: "Disassemble ARM: ARM64 with start address 0x1000", + input: "c0 03 5f d6", + expectedMatch: /0x00001000/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 4096, true, true], + }, + ], + }, + { + name: "Disassemble ARM: ARM32 with start address 0x8000", + input: "00 00 a0 e1", + expectedMatch: /0x00008000/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Little Endian", 32768, true, true], + }, + ], + }, + + // ==================== ENDIANNESS TESTS ==================== + { + name: "Disassemble ARM: ARM32 Big Endian", + input: "e1 a0 00 00", + expectedMatch: /mov\s+r0,\s*r0/, + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM (32-bit)", "ARM", "Big Endian", 0, true, true], + }, + ], + }, + + // ==================== EDGE CASES ==================== + { + name: "Disassemble ARM: Empty input", + input: "", + expectedOutput: "", + recipeConfig: [ + { + op: "Disassemble ARM", + args: ["ARM64 (AArch64)", "ARM", "Little Endian", 0, true, true], + }, + ], + }, +]); From 3f91df2381b6384a72b6e0223c4fd9ddf3d50606 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 15:44:02 +0000 Subject: [PATCH 007/208] Bump basic-ftp from 5.0.5 to 5.2.0 (#2231) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ab7c7fe..82b09719 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5316,9 +5316,9 @@ "license": "MIT" }, "node_modules/basic-ftp": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", - "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.0.tgz", + "integrity": "sha512-VoMINM2rqJwJgfdHq6RiUudKt2BV+FY5ZFezP/ypmwayk68+NzzAQy4XXLlqsGD4MCzq3DrmNFD/uUmBJuGoXw==", "dev": true, "license": "MIT", "engines": { From c39ae52f7fffc1830a9f781052d9afe745a916b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 10:03:27 +0000 Subject: [PATCH 008/208] Bump form-data from 4.0.1 to 4.0.5 (#2228) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 82b09719..42ddaf4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8594,6 +8594,22 @@ "node": ">= 0.4" } }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es6-object-assign": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", @@ -9701,14 +9717,16 @@ } }, "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { From 76bf4f44db2ccbe5407e7b8ad21d299250099e25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 10:29:22 +0000 Subject: [PATCH 009/208] Bump pbkdf2 from 3.1.2 to 3.1.5 (#2229) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 98 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 79 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 42ddaf4a..66507f80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14572,19 +14572,20 @@ } }, "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.5.tgz", + "integrity": "sha512-Q3CG/cYvCO1ye4QKkuH7EXxs3VC/rI1/trd+qX2+PolbaKG0H+bgcZzrTt96mMyRtejk+JMCiLUn3y29W8qmFQ==", "license": "MIT", "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "ripemd160": "^2.0.3", + "safe-buffer": "^5.2.1", + "sha.js": "^2.4.12", + "to-buffer": "^1.2.1" }, "engines": { - "node": ">=0.12" + "node": ">= 0.10" } }, "node_modules/peek-readable": { @@ -15697,13 +15698,31 @@ } }, "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.3.tgz", + "integrity": "sha512-5Di9UC0+8h1L6ZD2d7awM7E/T4uA1fJRlx6zk/NvdCCVEoAnFqvHmCuNeIKoCeIixBX/q8uM+6ycDvF8woqosA==", "license": "MIT", "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" + "hash-base": "^3.1.2", + "inherits": "^2.0.4" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/ripemd160/node_modules/hash-base": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.2.tgz", + "integrity": "sha512-Bb33KbowVTIj5s7Ked1OsqHUeCpz//tPwR+E2zJgJKo9Z5XolZ9b6bdUgjmYlwnWhoOQKoTd1TYToZGn5mAYOg==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.1" + }, + "engines": { + "node": ">= 0.8" } }, "node_modules/rison": { @@ -16140,16 +16159,23 @@ "license": "ISC" }, "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "version": "2.4.12", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz", + "integrity": "sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==", "license": "(MIT AND BSD-3-Clause)", "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.0" }, "bin": { "sha.js": "bin.js" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/shebang-command": { @@ -17157,6 +17183,26 @@ "node": ">=14.14" } }, + "node_modules/to-buffer": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz", + "integrity": "sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==", + "license": "MIT", + "dependencies": { + "isarray": "^2.0.5", + "safe-buffer": "^5.2.1", + "typed-array-buffer": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/to-buffer/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -17329,6 +17375,20 @@ "node": ">= 0.6" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/ua-parser-js": { "version": "1.0.41", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.41.tgz", From 64224dacb58b7dfecabf4824d55f36a14c6a1a5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 14:58:09 +0000 Subject: [PATCH 010/208] Bump jws from 3.2.2 to 3.2.3 (#2235) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 66507f80..4500c9c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12399,23 +12399,23 @@ } }, "node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", + "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", "license": "MIT", "dependencies": { - "buffer-equal-constant-time": "1.0.1", + "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz", + "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==", "license": "MIT", "dependencies": { - "jwa": "^1.4.1", + "jwa": "^1.4.2", "safe-buffer": "^5.0.1" } }, From 47ba05850bd1ea93f443c3e70e3c7db0c238cdd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 06:53:14 +0000 Subject: [PATCH 011/208] Bump axios from 1.7.9 to 1.13.6 (#2234) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4500c9c7..33c3c9aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5169,14 +5169,14 @@ } }, "node_modules/axios": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", - "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz", + "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==", "dev": true, "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", "proxy-from-env": "^1.1.0" } }, @@ -9634,9 +9634,9 @@ "license": "ISC" }, "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", "dev": true, "funding": [ { From d195a51e2e8df475be8056a215d3461b9342e260 Mon Sep 17 00:00:00 2001 From: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> Date: Wed, 11 Mar 2026 12:05:50 +0000 Subject: [PATCH 012/208] Update some dependencies, including a number causing npm audit warnings (#2236) Also includes a fix for some minor linting warnings. --- package-lock.json | 430 +++++++++++++++------------ package.json | 22 +- tests/node/tests/lib/BigIntUtils.mjs | 44 +-- 3 files changed, 275 insertions(+), 221 deletions(-) diff --git a/package-lock.json b/package-lock.json index 33c3c9aa..88c8d5e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "d3": "7.9.0", "d3-hexbin": "^0.2.2", "diff": "^5.2.2", - "dompurify": "^3.3.1", + "dompurify": "^3.3.3", "es6-promisify": "^7.0.0", "escodegen": "^2.1.0", "esprima": "^4.0.1", @@ -60,7 +60,7 @@ "json5": "^2.2.3", "jsonata": "^2.1.0", "jsonpath-plus": "^10.4.0", - "jsonwebtoken": "9.0.0", + "jsonwebtoken": "9.0.3", "jsqr": "^1.4.0", "jsrsasign": "^11.1.1", "kbpgp": "^2.1.17", @@ -93,7 +93,7 @@ "snackbarjs": "^1.1.0", "sortablejs": "^1.15.7", "split.js": "^1.6.5", - "sql-formatter": "^15.6.5", + "sql-formatter": "^15.6.12", "ssdeep.js": "0.0.3", "stream-browserify": "^3.0.0", "tesseract.js": "^6.0.1", @@ -114,11 +114,11 @@ "@babel/preset-env": "^7.29.0", "@babel/runtime": "^7.28.6", "@codemirror/commands": "^6.10.2", - "@codemirror/language": "^6.12.1", + "@codemirror/language": "^6.12.2", "@codemirror/search": "^6.6.0", "@codemirror/state": "^6.5.4", - "@codemirror/view": "^6.39.15", - "autoprefixer": "^10.4.24", + "@codemirror/view": "^6.39.17", + "autoprefixer": "^10.4.27", "babel-loader": "^10.0.0", "base64-loader": "^1.0.0", "chromedriver": "^130.0.4", @@ -129,7 +129,7 @@ "core-js": "^3.48.0", "cspell": "^8.19.4", "css-loader": "7.1.4", - "eslint": "^9.39.3", + "eslint": "^9.39.4", "eslint-plugin-jsdoc": "^50.8.0", "globals": "^15.15.0", "grunt": "^1.6.1", @@ -145,17 +145,17 @@ "grunt-zip": "^1.0.0", "html-webpack-plugin": "^5.6.6", "imports-loader": "^5.0.0", - "mini-css-extract-plugin": "2.10.0", + "mini-css-extract-plugin": "2.10.1", "modify-source-webpack-plugin": "^4.1.0", "nightwatch": "^3.15.0", - "postcss": "^8.5.6", + "postcss": "^8.5.8", "postcss-css-variables": "^0.19.0", "postcss-import": "^16.1.1", "postcss-loader": "^8.2.1", "prompt": "^1.3.0", - "sitemap": "^8.0.2", + "sitemap": "^8.0.3", "terser": "^5.46.0", - "webpack": "^5.105.2", + "webpack": "^5.105.4", "webpack-bundle-analyzer": "^4.10.2", "webpack-dev-server": "5.0.4", "webpack-node-externals": "^3.0.0", @@ -586,15 +586,15 @@ } }, "node_modules/@babel/helpers": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", - "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz", + "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@babel/template": "^7.25.9", - "@babel/types": "^7.26.0" + "@babel/template": "^7.28.6", + "@babel/types": "^7.28.6" }, "engines": { "node": ">=6.9.0" @@ -1890,9 +1890,9 @@ } }, "node_modules/@codemirror/view": { - "version": "6.39.16", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.39.16.tgz", - "integrity": "sha512-m6S22fFpKtOWhq8HuhzsI1WzUP/hB9THbDj0Tl5KX4gbO6Y91hwBl7Yky33NdvB6IffuRFiBxf1R8kJMyXmA4Q==", + "version": "6.39.17", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.39.17.tgz", + "integrity": "sha512-Aim4lFqhbijnchl83RLfABWueSGs1oUCSv0mru91QdhpXQeNKprIdRO9LWA4cYkJvuYTKGJN7++9MXx8XW43ag==", "dev": true, "license": "MIT", "dependencies": { @@ -4674,9 +4674,9 @@ } }, "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", + "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", "dev": true, "license": "MIT", "dependencies": { @@ -5020,9 +5020,9 @@ } }, "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", + "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", "license": "MIT" }, "node_modules/assert": { @@ -5447,9 +5447,9 @@ "license": "BSD-3-Clause" }, "node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.3.tgz", + "integrity": "sha512-EAcmnPkxpntVL+DS7bO1zhcZNvCkxqtkd0ZY53h06GNQ3DEkkGZ/gKgmDv6DdZQGj9BgfSPKtJJ7Dp1GPP8f7w==", "license": "MIT" }, "node_modules/body": { @@ -5465,24 +5465,24 @@ } }, "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", + "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", "dev": true, "license": "MIT", "dependencies": { - "bytes": "3.1.2", + "bytes": "~3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.14.0", + "raw-body": "~2.5.3", "type-is": "~1.6.18", - "unpipe": "1.0.0" + "unpipe": "~1.0.0" }, "engines": { "node": ">= 0.8", @@ -5510,20 +5510,24 @@ } }, "node_modules/body-parser/node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "dev": true, "license": "MIT", "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" }, "engines": { "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/body-parser/node_modules/iconv-lite": { @@ -5560,13 +5564,13 @@ } }, "node_modules/body-parser/node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "version": "6.14.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", + "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.6" + "side-channel": "^1.1.0" }, "engines": { "node": ">=0.6" @@ -5576,16 +5580,16 @@ } }, "node_modules/body-parser/node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", "dev": true, "license": "MIT", "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" }, "engines": { "node": ">= 0.8" @@ -5599,9 +5603,9 @@ "license": "ISC" }, "node_modules/body-parser/node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "dev": true, "license": "MIT", "engines": { @@ -5734,9 +5738,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -5822,24 +5826,23 @@ } }, "node_modules/browserify-sign": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", - "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.5.tgz", + "integrity": "sha512-C2AUdAJg6rlM2W5QMp2Q4KGQMVBwR1lIimTsUnutJ8bMpW5B52pGpR2gEnNBNwijumDo5FojQ0L9JrXA8m4YEw==", "license": "ISC", "dependencies": { - "bn.js": "^5.2.1", - "browserify-rsa": "^4.1.0", + "bn.js": "^5.2.2", + "browserify-rsa": "^4.1.1", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.5", - "hash-base": "~3.0", + "elliptic": "^6.6.1", "inherits": "^2.0.4", - "parse-asn1": "^5.1.7", + "parse-asn1": "^5.1.9", "readable-stream": "^2.3.8", "safe-buffer": "^5.2.1" }, "engines": { - "node": ">= 0.12" + "node": ">= 0.10" } }, "node_modules/browserify-zlib": { @@ -6595,9 +6598,9 @@ } }, "node_modules/compression": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.5.tgz", - "integrity": "sha512-bQJ0YRck5ak3LgtnpKkiabX5pNF7tMUh1BSy2ZBOTh0Dim0BUu6aPPwByIns6/A5Prh8PufSPerMDUklpzes2Q==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.1.tgz", + "integrity": "sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==", "dev": true, "license": "MIT", "dependencies": { @@ -6605,7 +6608,7 @@ "compressible": "~2.0.18", "debug": "2.6.9", "negotiator": "~0.6.4", - "on-headers": "~1.0.2", + "on-headers": "~1.1.0", "safe-buffer": "5.2.1", "vary": "~1.1.2" }, @@ -6932,9 +6935,9 @@ } }, "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", + "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", "license": "MIT" }, "node_modules/create-hash": { @@ -8184,9 +8187,9 @@ } }, "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", + "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", "license": "MIT" }, "node_modules/discontinuous-range": { @@ -8273,13 +8276,10 @@ } }, "node_modules/dompurify": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.2.tgz", - "integrity": "sha512-6obghkliLdmKa56xdbLOpUZ43pAR6xFy1uOrxBaIDjT+yaRuuybLjGS9eVBoSR/UPU5fq3OXClEHLJNGvbxKpQ==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.3.tgz", + "integrity": "sha512-Oj6pzI2+RqBfFG+qOaOLbFXLQ90ARpcGG6UePL82bJLtdsa6CYJD7nmiU8MW9nQNOtCHV3lZ/Bzq1X0QYbBZCA==", "license": "(MPL-2.0 OR Apache-2.0)", - "engines": { - "node": ">=20" - }, "optionalDependencies": { "@types/trusted-types": "^2.0.7" } @@ -8419,9 +8419,9 @@ } }, "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", + "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", "license": "MIT" }, "node_modules/emoji-regex": { @@ -9142,40 +9142,40 @@ } }, "node_modules/express": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", - "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", + "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", "dev": true, "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", + "body-parser": "~1.20.3", + "content-disposition": "~0.5.4", "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", "debug": "2.6.9", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", "merge-descriptors": "1.0.3", "methods": "~1.1.2", - "on-finished": "2.4.1", + "on-finished": "~2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.12", + "path-to-regexp": "~0.1.12", "proxy-addr": "~2.0.7", - "qs": "6.13.0", + "qs": "~6.14.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", + "send": "~0.19.0", + "serve-static": "~1.16.2", "setprototypeof": "1.2.0", - "statuses": "2.0.1", + "statuses": "~2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" @@ -9265,13 +9265,13 @@ } }, "node_modules/express/node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "version": "6.14.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", + "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.6" + "side-channel": "^1.1.0" }, "engines": { "node": ">=0.6" @@ -9469,9 +9469,9 @@ } }, "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9479,9 +9479,9 @@ } }, "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, "license": "ISC", "dependencies": { @@ -10571,9 +10571,9 @@ } }, "node_modules/grunt/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", "dev": true, "license": "MIT", "dependencies": { @@ -11037,9 +11037,9 @@ } }, "node_modules/http-proxy-middleware": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", - "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.9.tgz", + "integrity": "sha512-c1IyJYLYppU574+YI7R4QyX2ystMtVXZwIdzazUIPIJsHuWNd+mho2j+bKoHftndicGj9yh+xjd+l0yj7VeT1Q==", "dev": true, "license": "MIT", "dependencies": { @@ -12343,15 +12343,21 @@ } }, "node_modules/jsonwebtoken": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", - "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", + "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==", "license": "MIT", "dependencies": { - "jws": "^3.2.2", - "lodash": "^4.17.21", + "jws": "^4.0.1", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", "ms": "^2.1.1", - "semver": "^7.3.8" + "semver": "^7.5.4" }, "engines": { "node": ">=12", @@ -12399,9 +12405,9 @@ } }, "node_modules/jwa": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", - "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", "license": "MIT", "dependencies": { "buffer-equal-constant-time": "^1.0.1", @@ -12410,12 +12416,12 @@ } }, "node_modules/jws": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz", - "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", + "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", "license": "MIT", "dependencies": { - "jwa": "^1.4.2", + "jwa": "^2.0.1", "safe-buffer": "^5.0.1" } }, @@ -12693,6 +12699,18 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, "node_modules/lodash.isfinite": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", @@ -12700,11 +12718,28 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", - "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", "license": "MIT" }, "node_modules/lodash.merge": { @@ -12714,6 +12749,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, "node_modules/lodash.union": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", @@ -13010,9 +13051,9 @@ } }, "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", + "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", "license": "MIT" }, "node_modules/mime": { @@ -13062,9 +13103,9 @@ } }, "node_modules/mini-css-extract-plugin": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.10.0.tgz", - "integrity": "sha512-540P2c5dYnJlyJxTaSloliZexv8rji6rY8FhQN+WF/82iHQfA23j/xtJx97L+mXOML27EqksSek/g4eK7jaL3g==", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.10.1.tgz", + "integrity": "sha512-k7G3Y5QOegl380tXmZ68foBRRjE9Ljavx835ObdvmZjQ639izvZD8CS7BkWw1qKPPzHsGL/JDhl0uyU1zc2rJw==", "dev": true, "license": "MIT", "dependencies": { @@ -13285,9 +13326,9 @@ } }, "node_modules/morgan": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", - "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.1.tgz", + "integrity": "sha512-223dMRJtI/l25dJKWpgij2cMtywuG/WiUKXdvwfbhGKBhy1puASqXwFzmWZ7+K73vUPoR7SS2Qz2cI/g9MKw0A==", "dev": true, "license": "MIT", "dependencies": { @@ -13295,7 +13336,7 @@ "debug": "2.6.9", "depd": "~2.0.0", "on-finished": "~2.3.0", - "on-headers": "~1.0.2" + "on-headers": "~1.1.0" }, "engines": { "node": ">= 0.8.0" @@ -13582,6 +13623,19 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/nightwatch/node_modules/glob/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/nightwatch/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -13963,9 +14017,9 @@ } }, "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", "dev": true, "license": "MIT", "engines": { @@ -14327,16 +14381,15 @@ } }, "node_modules/parse-asn1": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", - "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.9.tgz", + "integrity": "sha512-fIYNuZ/HastSb80baGOuPRo1O9cf4baWw5WsAp7dBuUzeTD/BoaG8sVTdlPFksBE2lF21dN+A1AnrpIjSWqHHg==", "license": "ISC", "dependencies": { "asn1.js": "^4.10.1", "browserify-aes": "^1.2.0", "evp_bytestokey": "^1.0.3", - "hash-base": "~3.0", - "pbkdf2": "^3.1.2", + "pbkdf2": "^3.1.5", "safe-buffer": "^5.2.1" }, "engines": { @@ -15104,9 +15157,9 @@ } }, "node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", + "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", "license": "MIT" }, "node_modules/pump": { @@ -15177,9 +15230,9 @@ "license": "MIT" }, "node_modules/qs": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", - "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.1.0" @@ -15376,9 +15429,9 @@ } }, "node_modules/readdir-glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15386,9 +15439,9 @@ } }, "node_modules/readdir-glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, "license": "ISC", "dependencies": { @@ -15852,9 +15905,9 @@ } }, "node_modules/schema-utils/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", + "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", "dev": true, "license": "MIT", "dependencies": { @@ -16307,12 +16360,12 @@ "license": "ISC" }, "node_modules/simple-xml-to-json": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/simple-xml-to-json/-/simple-xml-to-json-1.2.3.tgz", - "integrity": "sha512-kWJDCr9EWtZ+/EYYM5MareWj2cRnZGF93YDNpH4jQiHB+hBIZnfPFSQiVMzZOdk+zXWqTZ/9fTeQNu2DqeiudA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/simple-xml-to-json/-/simple-xml-to-json-1.2.2.tgz", + "integrity": "sha512-bmJJf5YiYL60eOQk3gaVxbM6vgYuwrFydCEAA2x3jccHUTsAffiPyblS/yQGr8GDUQVxSDm3WwLNL5HmRqDUcg==", "license": "MIT", "engines": { - "node": ">=20.12.2" + "node": ">=14.20.0" } }, "node_modules/sirv": { @@ -17174,9 +17227,9 @@ } }, "node_modules/tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", "dev": true, "license": "MIT", "engines": { @@ -18022,9 +18075,9 @@ } }, "node_modules/webpack-dev-server/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18045,9 +18098,10 @@ } }, "node_modules/webpack-dev-server/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, "license": "ISC", "dependencies": { @@ -18082,13 +18136,13 @@ } }, "node_modules/webpack-dev-server/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" diff --git a/package.json b/package.json index d3519e0f..bcbcd48b 100644 --- a/package.json +++ b/package.json @@ -45,11 +45,11 @@ "@babel/preset-env": "^7.29.0", "@babel/runtime": "^7.28.6", "@codemirror/commands": "^6.10.2", - "@codemirror/language": "^6.12.1", + "@codemirror/language": "^6.12.2", "@codemirror/search": "^6.6.0", "@codemirror/state": "^6.5.4", - "@codemirror/view": "^6.39.15", - "autoprefixer": "^10.4.24", + "@codemirror/view": "^6.39.17", + "autoprefixer": "^10.4.27", "babel-loader": "^10.0.0", "base64-loader": "^1.0.0", "chromedriver": "^130.0.4", @@ -60,7 +60,7 @@ "core-js": "^3.48.0", "cspell": "^8.19.4", "css-loader": "7.1.4", - "eslint": "^9.39.3", + "eslint": "^9.39.4", "eslint-plugin-jsdoc": "^50.8.0", "globals": "^15.15.0", "grunt": "^1.6.1", @@ -76,17 +76,17 @@ "grunt-zip": "^1.0.0", "html-webpack-plugin": "^5.6.6", "imports-loader": "^5.0.0", - "mini-css-extract-plugin": "2.10.0", + "mini-css-extract-plugin": "2.10.1", "modify-source-webpack-plugin": "^4.1.0", "nightwatch": "^3.15.0", - "postcss": "^8.5.6", + "postcss": "^8.5.8", "postcss-css-variables": "^0.19.0", "postcss-import": "^16.1.1", "postcss-loader": "^8.2.1", "prompt": "^1.3.0", - "sitemap": "^8.0.2", + "sitemap": "^8.0.3", "terser": "^5.46.0", - "webpack": "^5.105.2", + "webpack": "^5.105.4", "webpack-bundle-analyzer": "^4.10.2", "webpack-dev-server": "5.0.4", "webpack-node-externals": "^3.0.0", @@ -121,7 +121,7 @@ "d3": "7.9.0", "d3-hexbin": "^0.2.2", "diff": "^5.2.2", - "dompurify": "^3.3.1", + "dompurify": "^3.3.3", "es6-promisify": "^7.0.0", "escodegen": "^2.1.0", "esprima": "^4.0.1", @@ -143,7 +143,7 @@ "json5": "^2.2.3", "jsonata": "^2.1.0", "jsonpath-plus": "^10.4.0", - "jsonwebtoken": "9.0.0", + "jsonwebtoken": "9.0.3", "jsqr": "^1.4.0", "jsrsasign": "^11.1.1", "kbpgp": "^2.1.17", @@ -176,7 +176,7 @@ "snackbarjs": "^1.1.0", "sortablejs": "^1.15.7", "split.js": "^1.6.5", - "sql-formatter": "^15.6.5", + "sql-formatter": "^15.6.12", "ssdeep.js": "0.0.3", "stream-browserify": "^3.0.0", "tesseract.js": "^6.0.1", diff --git a/tests/node/tests/lib/BigIntUtils.mjs b/tests/node/tests/lib/BigIntUtils.mjs index d75a4893..f745f91b 100644 --- a/tests/node/tests/lib/BigIntUtils.mjs +++ b/tests/node/tests/lib/BigIntUtils.mjs @@ -9,46 +9,46 @@ TestRegister.addApiTests([ const value = parseBigInt("1", "test value"); assert.deepStrictEqual(value, BigInt("1")); }), - + it("BigIntUtils: parseBigInt - large decimal", () => { const value = parseBigInt("123456789012345678901234567890", "test value"); assert.deepStrictEqual(value, BigInt("123456789012345678901234567890")); }), - + it("BigIntUtils: parseBigInt - hexadecimal lowercase", () => { const value = parseBigInt("0xff", "test value"); assert.deepStrictEqual(value, BigInt("255")); }), - + it("BigIntUtils: parseBigInt - hexadecimal uppercase", () => { const value = parseBigInt("0xFF", "test value"); assert.deepStrictEqual(value, BigInt("255")); }), - + it("BigIntUtils: parseBigInt - large hexadecimal", () => { const value = parseBigInt("0x123456789ABCDEF", "test value"); assert.deepStrictEqual(value, BigInt("0x123456789ABCDEF")); }), - + it("BigIntUtils: parseBigInt - whitespace trimming", () => { const value = parseBigInt(" 42 ", "test value"); assert.deepStrictEqual(value, BigInt("42")); }), - + it("BigIntUtils: parseBigInt - invalid input (text)", () => { assert.throws(() => parseBigInt("test", "test value"), { name: "Error", message: "test value must be decimal or hex (0x...)" }); }), - + it("BigIntUtils: parseBigInt - invalid input (hex without prefix)", () => { assert.throws(() => parseBigInt("FF", "test value"), { name: "Error", message: "test value must be decimal or hex (0x...)" }); }), - + it("BigIntUtils: parseBigInt - invalid input (mixed)", () => { assert.throws(() => parseBigInt("12abc", "test value"), { name: "Error", @@ -65,40 +65,40 @@ TestRegister.addApiTests([ const bezout2 = BigInt("1"); assert.deepStrictEqual(egcd(a, b), [gcd, bezout1, bezout2]); }), - + it("BigIntUtils: egcd - coprime numbers", () => { const [g, x, y] = egcd(BigInt("3"), BigInt("11")); assert.strictEqual(g, BigInt("1")); - // Verify Bzout identity: a*x + b*y = gcd + // Verify Bézout identity: a*x + b*y = gcd assert.strictEqual(BigInt("3") * x + BigInt("11") * y, g); }), - + it("BigIntUtils: egcd - non-coprime numbers", () => { const [g, x, y] = egcd(BigInt("240"), BigInt("46")); assert.strictEqual(g, BigInt("2")); - // Verify Bzout identity + // Verify Bézout identity assert.strictEqual(BigInt("240") * x + BigInt("46") * y, g); }), - + it("BigIntUtils: egcd - with zero", () => { const [g, x, y] = egcd(BigInt("17"), BigInt("0")); assert.strictEqual(g, BigInt("17")); assert.strictEqual(x, BigInt("1")); assert.strictEqual(y, BigInt("0")); }), - + it("BigIntUtils: egcd - identical numbers", () => { const [g, x, y] = egcd(BigInt("42"), BigInt("42")); assert.strictEqual(g, BigInt("42")); - // Verify Bzout identity + // Verify Bézout identity assert.strictEqual(BigInt("42") * x + BigInt("42") * y, g); }), - + it("BigIntUtils: egcd - large numbers", () => { const a = BigInt("123456789012345678901234567890"); const b = BigInt("987654321098765432109876543210"); const [g, x, y] = egcd(a, b); - // Verify Bzout identity + // Verify Bézout identity assert.strictEqual(a * x + b * y, g); }), @@ -108,7 +108,7 @@ TestRegister.addApiTests([ const result = modPow(BigInt("2"), BigInt("10"), BigInt("1000")); assert.strictEqual(result, BigInt("24")); }), - + it("BigIntUtils: modPow - RSA-like example", () => { // Common RSA public exponent const base = BigInt("123456789"); @@ -119,26 +119,26 @@ TestRegister.addApiTests([ assert(result < mod); assert(result >= BigInt("0")); }), - + it("BigIntUtils: modPow - exponent zero", () => { // Any number^0 = 1 const result = modPow(BigInt("999"), BigInt("0"), BigInt("100")); assert.strictEqual(result, BigInt("1")); }), - + it("BigIntUtils: modPow - base zero", () => { // 0^n = 0 const result = modPow(BigInt("0"), BigInt("5"), BigInt("100")); assert.strictEqual(result, BigInt("0")); }), - + it("BigIntUtils: modPow - large exponent", () => { // Test with very large exponent (efficient algorithm should handle this) const result = modPow(BigInt("3"), BigInt("1000000"), BigInt("1000000007")); assert(result >= BigInt("0")); assert(result < BigInt("1000000007")); }), - + it("BigIntUtils: modPow - modular inverse verification", () => { // If a*x . 1 (mod m), then modPow(a, 1, m) * x . 1 (mod m) const a = BigInt("3"); From 4deaa0de20d87bca166d1ed24075d308aa40bbbb Mon Sep 17 00:00:00 2001 From: am-periphery <138065765+am-periphery@users.noreply.github.com> Date: Sun, 15 Mar 2026 09:35:11 +0000 Subject: [PATCH 013/208] Fix broken Docker link in README (#2250) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 89f0371d..cc18a83f 100755 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Cryptographic operations in CyberChef should not be relied upon to provide secur **Prerequisites** -- [Docker](hhttps://www.docker.com/products/docker-desktop/) +- [Docker](https://www.docker.com/products/docker-desktop/) - Docker Desktop must be open and running on your machine From eef8d55d86742a3fd46ddfc5540cebfcb2ec012e Mon Sep 17 00:00:00 2001 From: John Brick Date: Thu, 19 Mar 2026 13:10:35 +0300 Subject: [PATCH 014/208] fix(A1Z26): return empty string instead of empty array for empty input (#2257) --- src/core/operations/A1Z26CipherDecode.mjs | 2 +- tests/operations/index.mjs | 1 + tests/operations/tests/A1Z26CipherDecode.mjs | 33 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/operations/tests/A1Z26CipherDecode.mjs diff --git a/src/core/operations/A1Z26CipherDecode.mjs b/src/core/operations/A1Z26CipherDecode.mjs index 0b097c2b..cc9aafbf 100644 --- a/src/core/operations/A1Z26CipherDecode.mjs +++ b/src/core/operations/A1Z26CipherDecode.mjs @@ -76,7 +76,7 @@ class A1Z26CipherDecode extends Operation { const delim = Utils.charRep(args[0] || "Space"); if (input.length === 0) { - return []; + return ""; } const bites = input.split(delim); diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index fb03a5f7..3585e270 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -14,6 +14,7 @@ import { setLongTestFailure, logTestReport } from "../lib/utils.mjs"; import TestRegister from "../lib/TestRegister.mjs"; +import "./tests/A1Z26CipherDecode.mjs"; import "./tests/AESKeyWrap.mjs"; import "./tests/AlternatingCaps.mjs"; import "./tests/AvroToJSON.mjs"; diff --git a/tests/operations/tests/A1Z26CipherDecode.mjs b/tests/operations/tests/A1Z26CipherDecode.mjs new file mode 100644 index 00000000..97020e0b --- /dev/null +++ b/tests/operations/tests/A1Z26CipherDecode.mjs @@ -0,0 +1,33 @@ +/** + * A1Z26 Cipher Decode tests + * + * @author brick-pixel + * @copyright Crown Copyright 2026 + * @license Apache-2.0 + */ +import TestRegister from "../../lib/TestRegister.mjs"; + +TestRegister.addTests([ + { + "name": "A1Z26 Cipher Decode: basic decode", + "input": "8 5 12 12 15", + "expectedOutput": "hello", + "recipeConfig": [ + { + "op": "A1Z26 Cipher Decode", + "args": ["Space"] + } + ] + }, + { + "name": "A1Z26 Cipher Decode: empty input returns empty string", + "input": "", + "expectedOutput": "", + "recipeConfig": [ + { + "op": "A1Z26 Cipher Decode", + "args": ["Space"] + } + ] + } +]); From 19bc8169ce706d09ea46b7462c0f430d56bd7b7b Mon Sep 17 00:00:00 2001 From: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:13:03 +0000 Subject: [PATCH 015/208] Configure dependabot updates (#2259) --- .github/dependabot.yml | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..cc66c319 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,72 @@ +# See the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + # + # Check for minor/patch versions only on a weekly basis - we are likely to be able to + # merge these routinely. Major versions we'll check for and update manually. + # + - package-ecosystem: 'npm' + directory: '/' + versioning-strategy: increase + schedule: + interval: 'weekly' + day: 'friday' + time: '03:00' + timezone: Europe/London + commit-message: + prefix: 'chore (deps): ' + ignore: + # we'll do any major version updates manually + - dependency-name: '*' + update-types: ['version-update:semver-major'] + # packages we can't currently update + # see issue #2214 for rationale for each of these + - dependency-name: '@xmldom/xmldom' + versions: [ '>=0.9.0' ] + - dependency-name: 'bcryptjs' + versions: [ '>=3.0.0' ] + - dependency-name: 'bootstrap' + versions: [ '>=5.0.0' ] + - dependency-name: 'bson' + versions: [ '>=5.0.0' ] + - dependency-name: 'cbor' + versions: [ '>=10.0.0' ] + - dependency-name: 'cspell' + versions: [ '>=9.0.0' ] + - dependency-name: 'eslint' + versions: [ '>=10.0.0' ] + - dependency-name: 'eslint-plugin-jsdoc' + versions: [ '>=51.0.0' ] + - dependency-name: 'fernet' + versions: [ '>=0.4.0' ] + - dependency-name: 'geodesy' + versions: [ '>=2.0.0' ] + - dependency-name: 'otpauth' + versions: [ '>=9.4.0' ] + - dependency-name: 'webpack-dev-server' + versions: [ '>=5.1.0' ] + groups: + # + # Grouping so we don't get a seperate PR for every patch version. + # + patch-updates: + applies-to: version-updates + patterns: + - '*' + update-types: + - 'patch' + + # Can't enable this until we are using Node 24 as the latest actions all require this version + # - package-ecosystem: "github-actions" + # # Workflow files stored in the default location of `.github/workflows`; no need to + # # specify `/.github/workflows` for `directory` + # directory: '/' + # schedule: + # interval: 'weekly' + # day: 'friday' + # time: '03:00' + # timezone: Europe/London + # commit-message: + # prefix: 'chore (deps): ' From d9dacf6b8fe064ff56037f1a52b0ada509d5dda4 Mon Sep 17 00:00:00 2001 From: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> Date: Thu, 19 Mar 2026 11:47:31 +0000 Subject: [PATCH 016/208] Fix Jq issue (#2210) * Revert "fix: jq-web -> jq-wasm, includes jq version 1.8.1 (gchq#2223)" This reverts commit 0c6454e. (but leave new tests intact) * Return jq-web to 0.5.1 --- package-lock.json | 12 ++++++------ package.json | 2 +- src/core/operations/Jq.mjs | 21 +++++++++++---------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 88c8d5e1..b4b293e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ "highlight.js": "^11.11.1", "ieee754": "^1.2.1", "jimp": "^1.6.0", - "jq-wasm": "^1.1.0-jq-1.8.1", + "jq-web": "^0.5.1", "jquery": "3.7.1", "js-sha3": "^0.9.3", "jsesc": "^3.1.0", @@ -12158,11 +12158,11 @@ "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", "license": "BSD-3-Clause" }, - "node_modules/jq-wasm": { - "version": "1.1.0-jq-1.8.1", - "resolved": "https://registry.npmjs.org/jq-wasm/-/jq-wasm-1.1.0-jq-1.8.1.tgz", - "integrity": "sha512-lWfu34lpDFIygOYcL5TzxhZIApDR9iR5XywcVoyUAZ6jlQrj8HKHOKeCcHgUm2dE9RVdbP3eqNAKGLuj+k4seQ==", - "license": "MIT" + "node_modules/jq-web": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/jq-web/-/jq-web-0.5.1.tgz", + "integrity": "sha512-3Fa3E6g3U1O1j46ljy0EM10yRr4txzILga8J7bqOG8F89gZ6Lilz82WG9z6TItWpYEO0YGa4W8yFGj+NMM1xqQ==", + "license": "ISC" }, "node_modules/jquery": { "version": "3.7.1", diff --git a/package.json b/package.json index bcbcd48b..2948556e 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "highlight.js": "^11.11.1", "ieee754": "^1.2.1", "jimp": "^1.6.0", - "jq-wasm": "^1.1.0-jq-1.8.1", + "jq-web": "^0.5.1", "jquery": "3.7.1", "js-sha3": "^0.9.3", "jsesc": "^3.1.0", diff --git a/src/core/operations/Jq.mjs b/src/core/operations/Jq.mjs index 4584d1a9..c1e02b34 100644 --- a/src/core/operations/Jq.mjs +++ b/src/core/operations/Jq.mjs @@ -6,7 +6,7 @@ import Operation from "../Operation.mjs"; import OperationError from "../errors/OperationError.mjs"; -import * as jq from "jq-wasm"; +import jq from "jq-web"; /** * jq operation @@ -40,15 +40,16 @@ class Jq extends Operation { * @returns {string} */ run(input, args) { - return (async () => { - const [query] = args; - try { - const result = await jq.json(input, query); - return JSON.stringify(result); - } catch (err) { - throw new OperationError(`Invalid jq expression: ${err.message}`); - } - })(); + const [query] = args; + let result; + + try { + result = jq.json(input, query); + } catch (err) { + throw new OperationError(`Invalid jq expression: ${err.message}`); + } + + return JSON.stringify(result); } } From f7bbb330843b2dd6e33216976c63d3acac957b38 Mon Sep 17 00:00:00 2001 From: d0s1nt Date: Thu, 19 Mar 2026 12:14:28 +0000 Subject: [PATCH 017/208] Add Extract Audio Metadata operation (#2170) Co-authored-by: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> (minor tweak to wikipedia url) --- src/core/config/Categories.json | 7 +- src/core/lib/AudioBytes.mjs | 103 +++ src/core/lib/AudioMetaSchema.mjs | 82 +++ src/core/lib/AudioParsers.mjs | 630 ++++++++++++++++++ src/core/operations/ExtractAudioMetadata.mjs | 175 +++++ tests/operations/index.mjs | 1 + .../operations/tests/ExtractAudioMetadata.mjs | 287 ++++++++ tests/samples/Audio.mjs | 73 ++ 8 files changed, 1356 insertions(+), 2 deletions(-) create mode 100644 src/core/lib/AudioBytes.mjs create mode 100644 src/core/lib/AudioMetaSchema.mjs create mode 100644 src/core/lib/AudioParsers.mjs create mode 100644 src/core/operations/ExtractAudioMetadata.mjs create mode 100644 tests/operations/tests/ExtractAudioMetadata.mjs create mode 100644 tests/samples/Audio.mjs diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index 8b62046e..88cb6dc1 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -385,6 +385,7 @@ "CSS selector", "Extract EXIF", "Extract ID3", + "Extract Audio Metadata", "Extract Files", "RAKE", "Template" @@ -514,7 +515,8 @@ "View Bit Plane", "Randomize Colour Palette", "Extract LSB", - "ELF Info" + "ELF Info", + "Extract Audio Metadata" ] }, { @@ -547,7 +549,8 @@ "Hex Density chart", "Scatter chart", "Series chart", - "Heatmap chart" + "Heatmap chart", + "Extract Audio Metadata" ] }, { diff --git a/src/core/lib/AudioBytes.mjs b/src/core/lib/AudioBytes.mjs new file mode 100644 index 00000000..9a433fcd --- /dev/null +++ b/src/core/lib/AudioBytes.mjs @@ -0,0 +1,103 @@ +/** + * Byte-reading and text-decoding utilities for audio metadata parsing. + * + * @author d0s1nt [d0s1nt@cyberchefaudio] + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +/** @returns {string} 4-byte ASCII at offset, or "" if out of bounds. */ +export function ascii4(b, off) { + if (off + 4 > b.length) return ""; + return String.fromCharCode(b[off], b[off + 1], b[off + 2], b[off + 3]); +} + +/** @returns {number} Byte offset of ASCII needle `s`, or -1. */ +export function indexOfAscii(b, s, start, end) { + const limit = Math.max(0, Math.min(end, b.length) - s.length); + for (let i = start; i <= limit; i++) { + let ok = true; + for (let j = 0; j < s.length; j++) { + if (b[i + j] !== s.charCodeAt(j)) { + ok = false; + break; + } + } + if (ok) return i; + } + return -1; +} + +/** @returns {number} Unsigned 32-bit big-endian read. */ +export function u32be(bytes, off) { + return ((bytes[off] << 24) >>> 0) | (bytes[off + 1] << 16) | (bytes[off + 2] << 8) | bytes[off + 3]; +} + +/** @returns {number} Unsigned 32-bit little-endian read. */ +export function u32le(bytes, off) { + return (bytes[off] | (bytes[off + 1] << 8) | (bytes[off + 2] << 16) | (bytes[off + 3] << 24)) >>> 0; +} + +/** @returns {number} Unsigned 16-bit little-endian read. */ +export function u16le(bytes, off) { + return bytes[off] | (bytes[off + 1] << 8); +} + +/** @returns {BigInt} Unsigned 64-bit little-endian read. */ +export function u64le(bytes, off) { + return BigInt(u32le(bytes, off)) | (BigInt(u32le(bytes, off + 4)) << 32n); +} + +/** @returns {number} Decoded ID3v2 synchsafe integer from four 7-bit bytes. */ +export function synchsafeToInt(b0, b1, b2, b3) { + return ((b0 & 0x7f) << 21) | ((b1 & 0x7f) << 14) | ((b2 & 0x7f) << 7) | (b3 & 0x7f); +} + +/** @returns {string} Decoded UTF-16LE byte range, nulls stripped. */ +export function decodeUtf16LE(b, off, len) { + if (len <= 0 || off + len > b.length) return ""; + try { + return new TextDecoder("utf-16le").decode(b.slice(off, off + len)).replace(/\u0000/g, "").trim(); + } catch { + return ""; + } +} + +/** @returns {{valueBytes: Uint8Array, next: number}} Bytes until null terminator, UTF-16 aware. */ +export function readNullTerminated(bytes, start, encoding) { + const isUtf16 = encoding === 1 || encoding === 2; + if (!isUtf16) { + let i = start; + while (i < bytes.length && bytes[i] !== 0x00) i++; + return { valueBytes: bytes.slice(start, i), next: i + 1 }; + } + let i = start; + while (i + 1 < bytes.length && !(bytes[i] === 0x00 && bytes[i + 1] === 0x00)) i += 2; + return { valueBytes: bytes.slice(start, i), next: i + 2 }; +} + +const ID3_ENCODINGS = ["iso-8859-1", "utf-16", "utf-16be", "utf-8"]; + +/** @returns {string} Text decoded using ID3v2 encoding byte (0=latin1, 1=utf16, 2=utf16be, 3=utf8). */ +export function decodeText(bytes, encoding) { + if (!bytes || bytes.length === 0) return ""; + try { + return new TextDecoder(ID3_ENCODINGS[encoding] || "utf-16").decode(bytes); + } catch { + return safeUtf8(bytes); + } +} + +/** @returns {string} UTF-8 decode with replacement (never throws). */ +export function safeUtf8(bytes) { + try { + return new TextDecoder("utf-8", { fatal: false }).decode(bytes); + } catch { + return ""; + } +} + +/** @returns {string} ISO-8859-1 decode, nulls stripped, trimmed. */ +export function decodeLatin1Trim(bytes) { + return decodeText(bytes, 0).replace(/\u0000/g, "").trim(); +} diff --git a/src/core/lib/AudioMetaSchema.mjs b/src/core/lib/AudioMetaSchema.mjs new file mode 100644 index 00000000..c46445be --- /dev/null +++ b/src/core/lib/AudioMetaSchema.mjs @@ -0,0 +1,82 @@ +/** + * Report skeleton and container detection for audio metadata extraction. + * + * @author d0s1nt [d0s1nt@cyberchefaudio] + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +/* eslint-disable camelcase */ + +import { ascii4, indexOfAscii } from "./AudioBytes.mjs"; + +/** Builds the empty report skeleton ready for a format parser to populate. */ +export function makeEmptyReport(filename, byteLength, container) { + return { + schema_version: "audio-meta-1.0", + artifact: { + filename, + byte_length: byteLength, + container: { type: container.type, brand: container.brand || null, mime: container.mime || null }, + }, + detections: { metadata_systems: [], provenance_systems: [] }, + tags: { + common: { + title: null, artist: null, album: null, date: null, track: null, + genre: null, comment: null, composer: null, copyright: null, language: null, + }, + raw: {}, + }, + embedded: [], + provenance: { + c2pa: { + present: false, + embedding: [], + manifest_store: { active_manifest_urn: null, instance_id: null, claim_generator: null }, + assertions: [], + signature: { + algorithm: null, signing_time: null, + certificate: { subject_cn: null, issuer_cn: null, serial_number: null }, + }, + validation: { validation_state: "Unknown", reasons: [], details_raw: null }, + }, + }, + errors: [], + }; +} + +/** Detects the audio container format from magic bytes. */ +export function sniffContainer(b) { + if (b.length >= 3 && b[0] === 0x49 && b[1] === 0x44 && b[2] === 0x33) + return { type: "mp3", mime: "audio/mpeg" }; + if (b.length >= 2 && b[0] === 0xff && (b[1] & 0xe0) === 0xe0) { + if ((b[1] & 0x06) === 0x00) return { type: "aac", mime: "audio/aac" }; + return { type: "mp3", mime: "audio/mpeg" }; + } + if (b.length >= 8 && b[0] === 0x0b && b[1] === 0x77) + return { type: "ac3", mime: "audio/ac3" }; + if (b.length >= 16 && + b[0] === 0x30 && b[1] === 0x26 && b[2] === 0xb2 && b[3] === 0x75 && + b[4] === 0x8e && b[5] === 0x66 && b[6] === 0xcf && b[7] === 0x11) + return { type: "wma", mime: "audio/x-ms-wma" }; + if (b.length >= 12 && ascii4(b, 0) === "RIFF" && ascii4(b, 8) === "WAVE") + return { type: "wav", mime: "audio/wav" }; + if (b.length >= 12 && ascii4(b, 0) === "BW64" && ascii4(b, 8) === "WAVE") + return { type: "bw64", mime: "audio/wav" }; + if (b.length >= 4 && ascii4(b, 0) === "fLaC") + return { type: "flac", mime: "audio/flac" }; + if (b.length >= 4 && ascii4(b, 0) === "OggS") { + const idx = indexOfAscii(b, "OpusHead", 0, Math.min(b.length, 65536)); + return idx >= 0 ? { type: "opus", mime: "audio/ogg" } : { type: "ogg", mime: "audio/ogg" }; + } + if (b.length >= 12 && ascii4(b, 4) === "ftyp") { + const brand = ascii4(b, 8); + const isM4A = brand === "M4A " || brand === "M4B " || brand === "M4P "; + return { type: isM4A ? "m4a" : "mp4", mime: isM4A ? "audio/mp4" : "video/mp4", brand }; + } + if (b.length >= 12 && ascii4(b, 0) === "FORM") { + const formType = ascii4(b, 8); + if (formType === "AIFF" || formType === "AIFC") return { type: "aiff", mime: "audio/aiff", brand: formType }; + } + return { type: "unknown", mime: null }; +} diff --git a/src/core/lib/AudioParsers.mjs b/src/core/lib/AudioParsers.mjs new file mode 100644 index 00000000..0e564b04 --- /dev/null +++ b/src/core/lib/AudioParsers.mjs @@ -0,0 +1,630 @@ +/** + * Format-specific audio metadata parsers. + * + * @author d0s1nt [d0s1nt@cyberchefaudio] + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +/* eslint-disable camelcase */ + +import { + ascii4, indexOfAscii, + u32be, u32le, u16le, u64le, synchsafeToInt, + decodeUtf16LE, readNullTerminated, decodeText, + safeUtf8, decodeLatin1Trim, +} from "./AudioBytes.mjs"; + +/** Parses MP3 metadata: ID3v2 frames, ID3v1 footer, APEv2 tags. */ +export function parseMp3(b, report) { + processId3v2(b, report); + processId3v1(b, report); + + const ape = parseApeV2BestEffort(b); + if (ape) { + report.detections.metadata_systems.push("apev2"); + report.tags.raw.apev2 = ape; + } +} + +/** Iterates ID3v2 frames and populates the report. */ +function processId3v2(b, report) { + report.detections.metadata_systems.push("id3v2"); + + const id3 = parseId3v2(b); + report.tags.raw.id3v2 = id3 ? { header: id3.header, frames: [] } : null; + + if (id3) { + for (const f of id3.frames) { + const entry = { id: f.id, size: f.size, description: ID3_FRAME_DESCRIPTIONS[f.id] || null }; + + if (f.id[0] === "T" && f.id !== "TXXX") { + const text = f.data?.length >= 1 ? + decodeText(f.data.slice(1), f.data[0]).replace(/\u0000/g, "").trim() : + ""; + entry.decoded = text; + if (f.id === "TLEN") { + const ms = normalizeTlen(text); + if (ms !== null) entry.normalized_ms = ms; + } + mapCommonId3(report, f.id, text); + } else if (f.id === "TXXX") { + const txxx = decodeTxxx(f.data); + entry.decoded = txxx; + if (!report.tags.raw.id3v2.txxx) report.tags.raw.id3v2.txxx = []; + report.tags.raw.id3v2.txxx.push(txxx); + } else if (f.id === "COMM") { + const comm = decodeCommFrame(f.data); + entry.decoded = comm; + if (comm?.text && !report.tags.common.comment) report.tags.common.comment = comm.text; + } else if (f.id === "GEOB") { + processGeobFrame(f, entry, report); + } + + report.tags.raw.id3v2.frames.push(entry); + } + } else { + report.detections.metadata_systems = report.detections.metadata_systems.filter((x) => x !== "id3v2"); + } +} + +/** Parses GEOB frame contents, populates entry, embedded objects, and C2PA provenance. */ +function processGeobFrame(f, entry, report) { + const d = f.data, enc = d[0]; + let off = 1; + const mime = readNullTerminated(d, off, 0); + const mimeType = decodeLatin1Trim(mime.valueBytes); + off = mime.next; + const file = readNullTerminated(d, off, enc); + const filename = decodeText(file.valueBytes, enc).replace(/\u0000/g, "").trim(); + off = file.next; + const desc = readNullTerminated(d, off, enc); + const description = decodeText(desc.valueBytes, enc).replace(/\u0000/g, "").trim(); + off = desc.next; + const objLen = d.length - off; + + entry.geob = { mimeType, filename, description, object_bytes: objLen }; + const geobId = `geob_${report.embedded.filter((x) => x.source === "id3v2:GEOB").length}`; + report.embedded.push({ + id: geobId, source: "id3v2:GEOB", + content_type: mimeType || null, byte_length: objLen, + description: description || null, filename: filename || null, + }); + + const mt = (mimeType || "").toLowerCase(); + if (mt.includes("c2pa") || mt.includes("jumbf") || mt.includes("application/x-c2pa-manifest-store")) { + report.provenance.c2pa.present = true; + report.provenance.c2pa.embedding.push({ + carrier: "id3v2:GEOB", content_type: mimeType || null, byte_length: objLen, + }); + } +} + +/** Processes the 128-byte ID3v1 footer tag. */ +function processId3v1(b, report) { + const id3v1 = parseId3v1(b); + if (!id3v1) return; + + report.detections.metadata_systems.push("id3v1"); + report.tags.raw.id3v1 = id3v1; + mapCommon(report, id3v1, ID3V1_TO_COMMON); +} + +/** Parses WAV/BWF/BW64 RIFF chunks: LIST/INFO, bext, iXML, axml, ds64. */ +export function parseRiffWave(b, report, maxTextBytes) { + report.detections.metadata_systems.push("riff_info"); + + const chunks = enumerateChunks(b, 12, b.length, 50000); + const riff = { chunks: [], info: null, bext: null, ixml: null, axml: null, ds64: null }; + + const info = {}; + for (const c of chunks) { + riff.chunks.push({ id: c.id, size: c.size, offset: c.dataOff }); + processRiffChunk(b, c, riff, info, report, maxTextBytes); + } + + riff.info = Object.keys(info).length ? info : null; + report.tags.raw.riff = riff; + if (riff.info) mapCommon(report, riff.info, RIFF_TO_COMMON); +} + +/** Processes a single RIFF chunk, updating riff state and the report. */ +function processRiffChunk(b, c, riff, info, report, maxTextBytes) { + if (c.id === "ds64") { + riff.ds64 = { present: true, size: c.size }; + if (!report.detections.metadata_systems.includes("bw64_ds64")) report.detections.metadata_systems.push("bw64_ds64"); + if (report.artifact.container.type === "wav") report.artifact.container.type = "bw64"; + } + + if (c.id === "LIST" && ascii4(b, c.dataOff) === "INFO") { + for (const s of enumerateChunks(b, c.dataOff + 4, c.dataOff + c.size, 10000)) + info[s.id] = decodeLatin1Trim(b.slice(s.dataOff, s.dataOff + s.size)); + } + + if (c.id === "bext") { + if (!report.detections.metadata_systems.includes("bwf_bext")) report.detections.metadata_systems.push("bwf_bext"); + riff.bext = parseBext(b, c.dataOff, c.size); + } + + if (c.id === "iXML" || c.id === "axml") { + const key = c.id === "iXML" ? "ixml" : "axml"; + if (!report.detections.metadata_systems.includes(key)) report.detections.metadata_systems.push(key); + const payload = b.slice(c.dataOff, c.dataOff + c.size); + riff[key] = { xml: safeUtf8(payload.slice(0, Math.min(payload.length, maxTextBytes))), truncated: payload.length > maxTextBytes }; + report.embedded.push({ + id: `${key}_0`, source: `riff:${c.id}`, content_type: "application/xml", + byte_length: payload.length, description: `${c.id} chunk`, filename: null, + }); + } +} + +/** Parses FLAC metablocks: STREAMINFO, Vorbis Comment, PICTURE. */ +export function parseFlac(b, report, maxTextBytes) { + report.detections.metadata_systems.push("flac_metablocks"); + + const blocks = parseFlacMetaBlocks(b); + report.tags.raw.flac = { blocks: [] }; + + for (const blk of blocks) { + report.tags.raw.flac.blocks.push({ type: blk.typeName, length: blk.length }); + + if (blk.typeName === "VORBIS_COMMENT") { + if (!report.detections.metadata_systems.includes("vorbis_comments")) report.detections.metadata_systems.push("vorbis_comments"); + const vc = parseVorbisComment(blk.data); + report.tags.raw.vorbis_comments = vc; + mapVorbisCommon(report, vc); + } else if (blk.typeName === "PICTURE") { + const pic = parseFlacPicture(blk.data, maxTextBytes); + report.embedded.push({ + id: `cover_art_${report.embedded.filter((x) => x.id.startsWith("cover_art_")).length}`, + source: "flac:PICTURE", content_type: pic.mime || null, + byte_length: pic.dataLength, description: pic.description || null, filename: null, + }); + } + } +} + +/** Parses OGG/Opus Vorbis comments. */ +export function parseOgg(b, report) { + if (!report.detections.metadata_systems.includes("ogg_opus_tags")) report.detections.metadata_systems.push("ogg_opus_tags"); + + const scanEnd = Math.min(b.length, 1024 * 1024); + let tags = null; + const opusTagsIdx = indexOfAscii(b, "OpusTags", 0, scanEnd); + if (opusTagsIdx >= 0) { + report.artifact.container.type = "opus"; + tags = parseVorbisComment(b.slice(opusTagsIdx + 8, scanEnd)); + } else { + const vorbisIdx = indexOfAscii(b, "\x03vorbis", 0, scanEnd); + if (vorbisIdx >= 0) tags = parseVorbisComment(b.slice(vorbisIdx + 7, scanEnd)); + } + + report.tags.raw.ogg = { has_opustags: opusTagsIdx >= 0, has_vorbis_comment: !!tags }; + + if (tags) { + if (!report.detections.metadata_systems.includes("vorbis_comments")) report.detections.metadata_systems.push("vorbis_comments"); + report.tags.raw.vorbis_comments = tags; + mapVorbisCommon(report, tags); + } +} + +/** Best-effort top-level atom scan for MP4/M4A. */ +export function parseMp4BestEffort(b, report) { + report.detections.metadata_systems.push("mp4_atoms"); + const atoms = []; + + let off = 0; + while (off + 8 <= b.length && atoms.length < 2000) { + const size = u32be(b, off); + const type = ascii4(b, off + 4); + if (size < 8) break; + atoms.push({ type, size, offset: off }); + off += size; + } + + report.tags.raw.mp4 = { + top_level_atoms: atoms.slice(0, 200), + hints: { + hasMoov: atoms.some((a) => a.type === "moov"), + hasUdta: atoms.some((a) => a.type === "udta"), + hasMeta: atoms.some((a) => a.type === "meta"), + hasIlst: atoms.some((a) => a.type === "ilst"), + }, + }; +} + +/** Best-effort AIFF/AIFC chunk scanning for NAME, AUTH, ANNO. */ +export function parseAiffBestEffort(b, report, maxTextBytes) { + report.detections.metadata_systems.push("aiff_chunks"); + let off = 12; + const chunks = []; + while (off + 8 <= b.length && chunks.length < 2000) { + const id = ascii4(b, off); + const size = u32be(b, off + 4); + const dataOff = off + 8; + chunks.push({ id, size, offset: off }); + + if (["NAME", "AUTH", "ANNO", "(c) "].includes(id)) { + const txt = safeUtf8(b.slice(dataOff, dataOff + Math.min(size, maxTextBytes))); + if (!report.tags.raw.aiff) report.tags.raw.aiff = { chunks: [] }; + report.tags.raw.aiff.chunks.push({ id, value: txt, truncated: size > maxTextBytes }); + } + + off = dataOff + size + (size % 2); + } + + if (!report.tags.raw.aiff) report.tags.raw.aiff = {}; + report.tags.raw.aiff.chunk_index = chunks.slice(0, 500); + + const nameChunk = report.tags.raw.aiff?.chunks?.find((ch) => ch.id === "NAME")?.value; + if (nameChunk) report.tags.common.title = report.tags.common.title || nameChunk; +} + +const AAC_SAMPLE_RATES = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350]; +const AAC_PROFILES = ["Main", "LC", "SSR", "LTP"]; +const AAC_CHANNELS = ["defined in AOT", "mono", "stereo", "3.0", "4.0", "5.0", "5.1", "7.1"]; + +/** Parses AAC ADTS frame header for audio parameters. */ +export function parseAacAdts(b, report) { + report.detections.metadata_systems.push("adts_header"); + if (b.length < 7) return; + + const id = (b[1] >> 3) & 0x01; + const profile = (b[2] >> 6) & 0x03; + const freqIdx = (b[2] >> 2) & 0x0f; + const chanCfg = ((b[2] & 0x01) << 2) | ((b[3] >> 6) & 0x03); + + report.tags.raw.aac = { + mpeg_version: id === 1 ? "MPEG-2" : "MPEG-4", + profile: AAC_PROFILES[profile] || `Profile ${profile}`, + sample_rate: AAC_SAMPLE_RATES[freqIdx] || null, + sample_rate_index: freqIdx, + channel_configuration: chanCfg, + channel_description: AAC_CHANNELS[chanCfg] || null, + }; +} + +const AC3_SAMPLE_RATES = [48000, 44100, 32000]; +const AC3_BITRATES = [32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640]; +const AC3_ACMODES = [ + "2.0 (Ch1+Ch2)", "1.0 (C)", "2.0 (L R)", "3.0 (L C R)", + "2.1 (L R S)", "3.1 (L C R S)", "2.2 (L R SL SR)", "3.2 (L C R SL SR)", +]; + +/** Parses AC3 (Dolby Digital) bitstream info. */ +export function parseAc3(b, report) { + report.detections.metadata_systems.push("ac3_bsi"); + if (b.length < 8) return; + + const fscod = (b[4] >> 6) & 0x03; + const frmsizecod = b[4] & 0x3f; + const bsid = (b[5] >> 3) & 0x1f; + const bsmod = b[5] & 0x07; + const acmod = (b[6] >> 5) & 0x07; + + report.tags.raw.ac3 = { + sample_rate: AC3_SAMPLE_RATES[fscod] || null, + fscod, + bitrate_kbps: AC3_BITRATES[frmsizecod >> 1] || null, + frmsizecod, bsid, bsmod, acmod, + channel_layout: AC3_ACMODES[acmod] || null, + }; +} + +/** Parses WMA files (ASF container) for content description metadata. */ +export function parseWmaAsf(b, report) { + report.detections.metadata_systems.push("asf_header"); + if (b.length < 30) return; + + const headerSize = Number(u64le(b, 16)); + const numObjects = u32le(b, 24); + const headerEnd = Math.min(b.length, headerSize); + + const objects = []; + let off = 30; + + for (let i = 0; i < numObjects && off + 24 <= headerEnd; i++) { + const guid4 = [b[off], b[off + 1], b[off + 2], b[off + 3]]; + const objSize = Number(u64le(b, off + 16)); + if (objSize < 24 || off + objSize > headerEnd) break; + + const dataOff = off + 24; + const dataLen = objSize - 24; + + if (guid4[0] === 0x33 && guid4[1] === 0x26 && guid4[2] === 0xb2 && guid4[3] === 0x75 && dataLen >= 10) { + const cd = parseAsfContentDescription(b, dataOff); + if (!report.detections.metadata_systems.includes("asf_content_desc")) + report.detections.metadata_systems.push("asf_content_desc"); + if (!report.tags.raw.asf) report.tags.raw.asf = {}; + report.tags.raw.asf.content_description = cd; + mapCommon(report, cd, ASF_CD_TO_COMMON); + } + + if (guid4[0] === 0x40 && guid4[1] === 0xa4 && guid4[2] === 0xd0 && guid4[3] === 0xd2 && dataLen >= 2) { + const ext = parseAsfExtContentDescription(b, dataOff, dataOff + dataLen); + if (!report.detections.metadata_systems.includes("asf_ext_content_desc")) + report.detections.metadata_systems.push("asf_ext_content_desc"); + if (!report.tags.raw.asf) report.tags.raw.asf = {}; + report.tags.raw.asf.extended_content = ext; + + const c = report.tags.common; + for (const d of ext) { + const field = WMA_TO_COMMON[(d.name || "").toUpperCase()]; + if (field && d.value) c[field] = c[field] || d.value; + } + } + + objects.push({ guid_prefix: guid4.map(x => x.toString(16).padStart(2, "0")).join(""), size: objSize }); + off += objSize; + } + + if (!report.tags.raw.asf) report.tags.raw.asf = {}; + report.tags.raw.asf.header_objects = objects; +} + +const ID3_FRAME_DESCRIPTIONS = { + TIT2: "Title/songname/content description", TPE1: "Lead performer(s)/Soloist(s)", + TRCK: "Track number/Position in set", TALB: "Album/Movie/Show title", + TDRC: "Recording time", TYER: "Year", TCON: "Content type", + TPE2: "Band/orchestra/accompaniment", TLEN: "Length (ms)", TCOM: "Composer", + COMM: "Comments", APIC: "Attached picture", GEOB: "General encapsulated object", + TXXX: "User defined text information frame", UFID: "Unique file identifier", PRIV: "Private frame", +}; + +const ID3_TO_COMMON = { + TIT2: "title", TPE1: "artist", TALB: "album", TDRC: "date", TYER: "date", + TRCK: "track", TCON: "genre", COMM: "comment", TCOM: "composer", TCOP: "copyright", TLAN: "language", +}; +const VORBIS_TO_COMMON = { + TITLE: "title", ARTIST: "artist", ALBUM: "album", DATE: "date", + TRACKNUMBER: "track", GENRE: "genre", COMMENT: "comment", COMPOSER: "composer", LANGUAGE: "language", +}; +const WMA_TO_COMMON = { + "WM/ALBUMTITLE": "album", "WM/GENRE": "genre", "WM/YEAR": "date", + "WM/TRACKNUMBER": "track", "WM/COMPOSER": "composer", "WM/LANGUAGE": "language", +}; +const ID3V1_TO_COMMON = { title: "title", artist: "artist", album: "album", year: "date", comment: "comment", genre: "genre", track: "track" }; +const RIFF_TO_COMMON = { INAM: "title", IART: "artist", ICMT: "comment", IGNR: "genre", ICRD: "date", ICOP: "copyright" }; +const ASF_CD_TO_COMMON = { title: "title", author: "artist", copyright: "copyright", description: "comment" }; + +/** Maps source object fields to the common tags layer via a mapping table. */ +function mapCommon(report, source, mapping) { + const c = report.tags.common; + for (const [sk, ck] of Object.entries(mapping)) + c[ck] = c[ck] || source[sk] || null; +} + +/** Maps an ID3v2 frame value to the common tags layer. */ +function mapCommonId3(report, frameId, text) { + const field = ID3_TO_COMMON[frameId]; + if (field) report.tags.common[field] = report.tags.common[field] || text || null; +} + +/** Decodes an ID3v2 COMM (Comments) frame. */ +function decodeCommFrame(data) { + if (!data || data.length < 5) return null; + const enc = data[0]; + const language = String.fromCharCode(data[1], data[2], data[3]); + const { valueBytes: descBytes, next } = readNullTerminated(data, 4, enc); + const short_description = decodeText(descBytes, enc).replace(/\u0000/g, "").trim() || null; + const text = decodeText(data.slice(next), enc).replace(/\u0000/g, "").trim() || null; + return { language, short_description, text }; +} + +/** Normalizes TLEN to integer milliseconds. */ +function normalizeTlen(s) { + if (!s) return null; + if (/^\s*\d+\s*$/.test(s)) return parseInt(s.trim(), 10); + const f = Number(s); + if (Number.isFinite(f) && f > 0 && f < 100000) return Math.round(f * 1000); + return null; +} + +/** Parses the ID3v2 tag header and frames. */ +function parseId3v2(mp3) { + if (mp3.length < 10 || mp3[0] !== 0x49 || mp3[1] !== 0x44 || mp3[2] !== 0x33) return null; + + const major = mp3[3], minor = mp3[4], flags = mp3[5]; + const tagSize = synchsafeToInt(mp3[6], mp3[7], mp3[8], mp3[9]); + let offset = 10; + const end = 10 + tagSize; + + const frames = []; + while (offset + 10 <= end) { + const id = String.fromCharCode(mp3[offset], mp3[offset + 1], mp3[offset + 2], mp3[offset + 3]); + if (!/^[A-Z0-9]{4}$/.test(id)) break; + const size = major === 4 ? + synchsafeToInt(mp3[offset + 4], mp3[offset + 5], mp3[offset + 6], mp3[offset + 7]) : + u32be(mp3, offset + 4); + offset += 10; + if (size <= 0 || offset + size > mp3.length) break; + frames.push({ id, size, data: mp3.slice(offset, offset + size) }); + offset += size; + } + + return { header: { version: `${major}.${minor}`, flags, tag_size: tagSize }, frames }; +} + +/** Parses the 128-byte ID3v1 tag at the end of the file. */ +function parseId3v1(b) { + if (b.length < 128) return null; + const off = b.length - 128; + if (b[off] !== 0x54 || b[off + 1] !== 0x41 || b[off + 2] !== 0x47) return null; + + let track = null; + if (b[off + 125] === 0x00 && b[off + 126] !== 0x00) track = String(b[off + 126]); + + return { + title: decodeLatin1Trim(b.slice(off + 3, off + 33)), + artist: decodeLatin1Trim(b.slice(off + 33, off + 63)), + album: decodeLatin1Trim(b.slice(off + 63, off + 93)), + year: decodeLatin1Trim(b.slice(off + 93, off + 97)), + comment: decodeLatin1Trim(b.slice(off + 97, off + 127)), + track, genre: String(b[off + 127]), + }; +} + +/** Decodes an ID3v2 TXXX (user-defined text) frame. */ +function decodeTxxx(data) { + if (!data || data.length < 2) return null; + const enc = data[0]; + const { valueBytes: descBytes, next } = readNullTerminated(data, 1, enc); + const desc = decodeText(descBytes, enc).replace(/\u0000/g, "").trim(); + const val = decodeText(data.slice(next), enc).replace(/\u0000/g, "").trim(); + return { description: desc || null, value: val || null }; +} + +/** Best-effort APEv2 tag parser scanning the last 32 KB. */ +function parseApeV2BestEffort(b) { + const scanStart = Math.max(0, b.length - 32768); + const idx = indexOfAscii(b, "APETAGEX", scanStart, b.length); + if (idx < 0) return null; + if (idx + 32 > b.length) return { present: true, warning: "APETAGEX found but footer truncated." }; + + const ver = u32le(b, idx + 8), size = u32le(b, idx + 12); + const count = u32le(b, idx + 16), flags = u32le(b, idx + 20); + + const tagStart = idx + 32 - size; + if (tagStart < 0 || tagStart >= b.length) + return { present: true, version: ver, size, count, flags, warning: "APEv2 bounds invalid (non-standard placement)." }; + + const items = []; + let off = tagStart + 32; + const end = Math.min(b.length, idx); + while (off + 8 < end && items.length < 5000) { + const valueSize = u32le(b, off), itemFlags = u32le(b, off + 4); + off += 8; + let keyEnd = off; + while (keyEnd < end && b[keyEnd] !== 0x00) keyEnd++; + const key = decodeLatin1Trim(b.slice(off, keyEnd)); + off = keyEnd + 1; + if (!key || off + valueSize > end) break; + const value = safeUtf8(b.slice(off, off + valueSize)).replace(/\u0000/g, "").trim(); + off += valueSize; + items.push({ key, value, flags: itemFlags }); + } + + return { present: true, version: ver, size, count, flags, items }; +} + +/** Enumerates RIFF-style chunks (id + LE32 size) within a byte range, padding to even. */ +function enumerateChunks(b, start, end, maxCount) { + const chunks = []; + let off = start; + while (off + 8 <= end && chunks.length < maxCount) { + const id = ascii4(b, off); + const size = u32le(b, off + 4); + const dataOff = off + 8; + if (dataOff + size > end) break; + chunks.push({ id, size, dataOff }); + off = dataOff + size + (size % 2); + } + return chunks; +} + +/** Parses a BWF bext chunk. */ +function parseBext(b, off, size) { + const slice = b.slice(off, off + size); + const timeRefLow = u32le(slice, 338), timeRefHigh = u32le(slice, 342); + return { + description: decodeLatin1Trim(slice.slice(0, 256)) || null, + originator: decodeLatin1Trim(slice.slice(256, 288)) || null, + originator_reference: decodeLatin1Trim(slice.slice(288, 320)) || null, + origination_date: decodeLatin1Trim(slice.slice(320, 330)) || null, + origination_time: decodeLatin1Trim(slice.slice(330, 338)) || null, + time_reference_samples: ((BigInt(timeRefHigh) << 32n) | BigInt(timeRefLow)).toString(), + }; +} + +const FLAC_TYPE_NAMES = { 0: "STREAMINFO", 1: "PADDING", 2: "APPLICATION", 3: "SEEKTABLE", 4: "VORBIS_COMMENT", 5: "CUESHEET", 6: "PICTURE" }; + +/** Parses FLAC metadata blocks following the "fLaC" marker. */ +function parseFlacMetaBlocks(b) { + const blocks = []; + let off = 4; + while (off + 4 <= b.length && blocks.length < 10000) { + const header = b[off]; + const isLast = (header & 0x80) !== 0; + const type = header & 0x7f; + const len = (b[off + 1] << 16) | (b[off + 2] << 8) | b[off + 3]; + off += 4; + if (off + len > b.length) break; + blocks.push({ type, typeName: FLAC_TYPE_NAMES[type] || `TYPE_${type}`, length: len, data: b.slice(off, off + len) }); + off += len; + if (isLast) break; + } + return blocks; +} + +/** Parses a Vorbis Comment block (used by FLAC and OGG). */ +function parseVorbisComment(buf) { + let off = 0; + const vendorLen = u32le(buf, off); off += 4; + if (off + vendorLen > buf.length) return { vendor: null, comments: [], warning: "vendor_len out of bounds" }; + const vendor = safeUtf8(buf.slice(off, off + vendorLen)); off += vendorLen; + const count = u32le(buf, off); off += 4; + + const comments = []; + for (let i = 0; i < count && off + 4 <= buf.length && comments.length < 20000; i++) { + const l = u32le(buf, off); off += 4; + if (off + l > buf.length) break; + const s = safeUtf8(buf.slice(off, off + l)); off += l; + const eq = s.indexOf("="); + if (eq > 0) comments.push({ key: s.slice(0, eq).toUpperCase(), value: s.slice(eq + 1) }); + } + return { vendor, comments }; +} + +/** Maps Vorbis Comment fields to the common tags layer. */ +function mapVorbisCommon(report, vc) { + const c = report.tags.common; + for (const [vk, ck] of Object.entries(VORBIS_TO_COMMON)) + c[ck] = c[ck] || vc.comments?.find((x) => x.key === vk)?.value || null; +} + +/** Parses a FLAC PICTURE metadata block (extracts mime, description, data length). */ +function parseFlacPicture(data, maxTextBytes) { + let off = 4; + const mimeLen = u32be(data, off); off += 4; + const mime = safeUtf8(data.slice(off, off + Math.min(mimeLen, maxTextBytes))); off += mimeLen; + const descLen = u32be(data, off); off += 4; + const description = safeUtf8(data.slice(off, off + Math.min(descLen, maxTextBytes))); off += descLen + 16; + return { mime, description, dataLength: u32be(data, off) }; +} + +/** Parses the ASF Content Description Object fields. */ +function parseAsfContentDescription(b, off) { + const titleLen = u16le(b, off), authorLen = u16le(b, off + 2); + const copyrightLen = u16le(b, off + 4), descLen = u16le(b, off + 6), ratingLen = u16le(b, off + 8); + let pos = off + 10; + const title = decodeUtf16LE(b, pos, titleLen); pos += titleLen; + const author = decodeUtf16LE(b, pos, authorLen); pos += authorLen; + const copyright = decodeUtf16LE(b, pos, copyrightLen); pos += copyrightLen; + const description = decodeUtf16LE(b, pos, descLen); pos += descLen; + const rating = decodeUtf16LE(b, pos, ratingLen); + return { title, author, copyright, description, rating }; +} + +/** Parses the ASF Extended Content Description Object descriptors. */ +function parseAsfExtContentDescription(b, off, end) { + const count = u16le(b, off); + let pos = off + 2; + const descriptors = []; + for (let i = 0; i < count && pos + 6 <= end && descriptors.length < 5000; i++) { + const nameLen = u16le(b, pos); pos += 2; + if (pos + nameLen > end) break; + const name = decodeUtf16LE(b, pos, nameLen); pos += nameLen; + const valueType = u16le(b, pos); pos += 2; + const valueLen = u16le(b, pos); pos += 2; + if (pos + valueLen > end) break; + let value; + if (valueType === 0) value = decodeUtf16LE(b, pos, valueLen); + else if (valueType === 3) value = u32le(b, pos); + else if (valueType === 5) value = u16le(b, pos); + else if (valueType === 2) value = u32le(b, pos) !== 0; + else value = `(${valueLen} bytes, type ${valueType})`; + pos += valueLen; + descriptors.push({ name, value_type: valueType, value }); + } + return descriptors; +} diff --git a/src/core/operations/ExtractAudioMetadata.mjs b/src/core/operations/ExtractAudioMetadata.mjs new file mode 100644 index 00000000..7018ffd0 --- /dev/null +++ b/src/core/operations/ExtractAudioMetadata.mjs @@ -0,0 +1,175 @@ +/** + * @author d0s1nt [d0s1nt@cyberchefaudio] + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import OperationError from "../errors/OperationError.mjs"; +import Utils from "../Utils.mjs"; +import { makeEmptyReport, sniffContainer } from "../lib/AudioMetaSchema.mjs"; +import { + parseMp3, parseRiffWave, parseFlac, parseOgg, + parseMp4BestEffort, parseAiffBestEffort, + parseAacAdts, parseAc3, parseWmaAsf, +} from "../lib/AudioParsers.mjs"; + +/** + * Extract Audio Metadata operation. + */ +class ExtractAudioMetadata extends Operation { + /** Creates the Extract Audio Metadata operation. */ + constructor() { + super(); + + this.name = "Extract Audio Metadata"; + this.module = "Default"; + this.description = + "Extract common audio metadata across MP3 (ID3v2/ID3v1/GEOB), WAV/BWF/BW64 (INFO/bext/iXML/axml), FLAC (Vorbis Comment/Picture), OGG (Vorbis/OpusTags), AAC (ADTS), AC3 (Dolby Digital), WMA (ASF), plus best-effort MP4/M4A and AIFF scanning. Outputs normalized JSON."; + this.infoURL = "https://wikipedia.org/wiki/Audio_file_format"; + this.inputType = "ArrayBuffer"; + this.outputType = "JSON"; + this.presentType = "html"; + + this.args = [ + { name: "Filename (optional)", type: "string", value: "" }, + { name: "Max embedded text bytes (iXML/axml/etc)", type: "number", value: 1024 * 512 }, + ]; + } + + /** + * @param {ArrayBuffer} input + * @param {Object[]} args + * @returns {Object} + */ + run(input, args) { + const filename = (args?.[0] || "").trim() || null; + const maxTextBytes = Number.isFinite(args?.[1]) ? Math.max(1024, args[1]) : 1024 * 512; + + if (!(input instanceof ArrayBuffer) || input.byteLength === 0) + throw new OperationError("No input data. Load an audio file (drag/drop or use the open file button)."); + + const bytes = new Uint8Array(input); + const container = sniffContainer(bytes); + const report = makeEmptyReport(filename, bytes.length, container); + + try { + const parsers = { + mp3: () => parseMp3(bytes, report), + wav: () => parseRiffWave(bytes, report, maxTextBytes), + bw64: () => parseRiffWave(bytes, report, maxTextBytes), + flac: () => parseFlac(bytes, report, maxTextBytes), + ogg: () => parseOgg(bytes, report), + opus: () => parseOgg(bytes, report), + mp4: () => parseMp4BestEffort(bytes, report), + m4a: () => parseMp4BestEffort(bytes, report), + aiff: () => parseAiffBestEffort(bytes, report, maxTextBytes), + aac: () => parseAacAdts(bytes, report), + ac3: () => parseAc3(bytes, report), + wma: () => parseWmaAsf(bytes, report), + }; + if (parsers[container.type]) { + parsers[container.type](); + } else { + report.errors.push({ stage: "sniff", message: "Unknown/unsupported container (best-effort scan not implemented)." }); + } + } catch (e) { + report.errors.push({ stage: "parse", message: String(e?.message || e) }); + } + + return report; + } + + /** Renders the extracted metadata as an HTML table. */ + present(data) { + if (!data || typeof data !== "object") return JSON.stringify(data, null, 4); + + const esc = Utils.escapeHtml; + const row = (k, v) => `${esc(String(k))}${esc(String(v ?? ""))}\n`; + const section = (title) => `${esc(title)}\n`; + const objRows = (obj, filter = (v) => v !== null) => { + for (const [k, v] of Object.entries(obj)) { + if (filter(v)) html += row(k, v); + } + }; + const objSection = (obj, title, filter) => { + if (!obj) return; + html += section(title); + objRows(obj, filter); + }; + const listSection = (arr, title, fmt) => { + if (!arr?.length) return; + html += section(title); + for (const item of arr) html += fmt(item); + }; + + let html = `\n`; + + html += section("Artifact"); + html += row("Filename", data.artifact?.filename || "(none)"); + html += row("Size", `${(data.artifact?.byte_length ?? 0).toLocaleString()} bytes`); + html += row("Container", data.artifact?.container?.type); + html += row("MIME", data.artifact?.container?.mime); + if (data.artifact?.container?.brand) html += row("Brand", data.artifact.container.brand); + + html += section("Detections"); + html += row("Metadata systems", (data.detections?.metadata_systems || []).join(", ") || "None"); + html += row("Provenance systems", (data.detections?.provenance_systems || []).join(", ") || "None"); + + const common = data.tags?.common || {}; + html += section("Common Tags"); + if (Object.values(common).some((v) => v !== null)) { + for (const [key, val] of Object.entries(common)) { + if (val !== null) html += row(key.charAt(0).toUpperCase() + key.slice(1), val); + } + } else { + html += row("(none)", "No common tags found"); + } + + listSection(data.tags?.raw?.id3v2?.frames, "ID3v2 Frames", (f) => { + const val = typeof f.decoded === "object" ? JSON.stringify(f.decoded) : (f.decoded ?? `(${f.size} bytes)`); + return row(f.id + (f.description ? ` \u2014 ${f.description}` : ""), val); + }); + objSection(data.tags?.raw?.id3v1, "ID3v1", (v) => !!v); + listSection(data.tags?.raw?.apev2?.items, "APEv2 Tags", (i) => row(i.key, i.value)); + + if (data.tags?.raw?.vorbis_comments?.comments?.length) { + html += section("Vorbis Comments"); + html += row("Vendor", data.tags.raw.vorbis_comments.vendor); + for (const c of data.tags.raw.vorbis_comments.comments) html += row(c.key, c.value); + } + + objSection(data.tags?.raw?.riff?.info, "RIFF INFO", () => true); + objSection(data.tags?.raw?.riff?.bext, "BWF bext"); + listSection(data.tags?.raw?.riff?.chunks, "RIFF Chunks", (c) => row(c.id, `${c.size} bytes @ offset ${c.offset}`)); + listSection(data.tags?.raw?.flac?.blocks, "FLAC Metadata Blocks", (b) => row(b.type, `${b.length} bytes`)); + + if (data.tags?.raw?.mp4?.top_level_atoms?.length) { + html += section("MP4 Top-Level Atoms"); + const atoms = data.tags.raw.mp4.top_level_atoms; + for (const a of atoms.slice(0, 50)) html += row(a.type, `${a.size} bytes @ offset ${a.offset}`); + if (atoms.length > 50) html += row("...", `${atoms.length - 50} more atoms`); + } + + listSection(data.tags?.raw?.aiff?.chunks, "AIFF Chunks", (c) => row(c.id, c.value)); + objSection(data.tags?.raw?.aac, "AAC ADTS"); + objSection(data.tags?.raw?.ac3, "AC3 (Dolby Digital)"); + objSection(data.tags?.raw?.asf?.content_description, "ASF Content Description", (v) => !!v); + listSection(data.tags?.raw?.asf?.extended_content, "ASF Extended Content", (d) => row(d.name, d.value)); + listSection(data.embedded, "Embedded Objects", (e) => row(e.id, `${e.content_type || "unknown"} \u2014 ${(e.byte_length ?? 0).toLocaleString()} bytes`)); + + if (data.provenance?.c2pa?.present) { + html += section("C2PA Provenance"); + html += row("Present", "Yes"); + for (const emb of (data.provenance.c2pa.embedding || [])) + html += row("Carrier", `${emb.carrier} \u2014 ${(emb.byte_length ?? 0).toLocaleString()} bytes`); + } + + listSection(data.errors, "Errors", (e) => row(e.stage, e.message)); + + html += "
"; + return html; + } +} + +export default ExtractAudioMetadata; diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 3585e270..2134cdd9 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -67,6 +67,7 @@ import "./tests/DropNthBytes.mjs"; import "./tests/ECDSA.mjs"; import "./tests/ELFInfo.mjs"; import "./tests/Enigma.mjs"; +import "./tests/ExtractAudioMetadata.mjs"; import "./tests/ExtractEmailAddresses.mjs"; import "./tests/ExtractHashes.mjs"; import "./tests/ExtractIPAddresses.mjs"; diff --git a/tests/operations/tests/ExtractAudioMetadata.mjs b/tests/operations/tests/ExtractAudioMetadata.mjs new file mode 100644 index 00000000..24fa3671 --- /dev/null +++ b/tests/operations/tests/ExtractAudioMetadata.mjs @@ -0,0 +1,287 @@ +/** + * Extract Audio Metadata operation tests. + * + * @author d0s1nt + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ +import TestRegister from "../../lib/TestRegister.mjs"; +import { + MP3_HEX, WAV_HEX, FLAC_HEX, AAC_HEX, + AC3_HEX, OGG_HEX, OPUS_HEX, WMA_HEX, + M4A_HEX, AIFF_HEX +} from "../../samples/Audio.mjs"; + +TestRegister.addTests([ + // ---- MP3 ---- + { + name: "Extract Audio Metadata: MP3 container and MIME", + input: MP3_HEX, + expectedMatch: /Container<\/td>mp3<\/td>.*MIME<\/td>audio\/mpeg<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.mp3", 524288] } + ] + }, + { + name: "Extract Audio Metadata: MP3 common tags (title, artist)", + input: MP3_HEX, + expectedMatch: /Title<\/td>Galway<\/td>.*Artist<\/td>Kevin MacLeod<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.mp3", 524288] } + ] + }, + { + name: "Extract Audio Metadata: MP3 ID3v2 frames (TIT2, TPE1, TSSE)", + input: MP3_HEX, + expectedMatch: /ID3v2 Frames.*TIT2.*Galway.*TPE1.*Kevin MacLeod.*TSSE.*Lavf56\.40\.101/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.mp3", 524288] } + ] + }, + { + name: "Extract Audio Metadata: MP3 detections (id3v2)", + input: MP3_HEX, + expectedMatch: /Metadata systems<\/td>id3v2<\/td>/, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.mp3", 524288] } + ] + }, + + // ---- WAV ---- + { + name: "Extract Audio Metadata: WAV container and MIME", + input: WAV_HEX, + expectedMatch: /Container<\/td>wav<\/td>.*MIME<\/td>audio\/wav<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.wav", 524288] } + ] + }, + { + name: "Extract Audio Metadata: WAV RIFF chunks (fmt)", + input: WAV_HEX, + expectedMatch: /RIFF Chunks.*fmt .*16 bytes @ offset 20/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.wav", 524288] } + ] + }, + + // ---- FLAC ---- + { + name: "Extract Audio Metadata: FLAC container and common tags", + input: FLAC_HEX, + expectedMatch: /Container<\/td>flac<\/td>.*Title<\/td>Galway<\/td>.*Artist<\/td>Kevin MacLeod<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.flac", 524288] } + ] + }, + { + name: "Extract Audio Metadata: FLAC metadata blocks (STREAMINFO, VORBIS_COMMENT)", + input: FLAC_HEX, + expectedMatch: /FLAC Metadata Blocks.*STREAMINFO<\/td>34 bytes<\/td>.*VORBIS_COMMENT<\/td>86 bytes<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.flac", 524288] } + ] + }, + { + name: "Extract Audio Metadata: FLAC Vorbis comments (vendor, tags)", + input: FLAC_HEX, + expectedMatch: /Vorbis Comments.*Vendor<\/td>Lavf56\.40\.101<\/td>.*TITLE<\/td>Galway<\/td>.*ARTIST<\/td>Kevin MacLeod<\/td>.*ENCODER<\/td>Lavf56\.40\.101<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.flac", 524288] } + ] + }, + { + name: "Extract Audio Metadata: FLAC detections", + input: FLAC_HEX, + expectedMatch: /Metadata systems<\/td>flac_metablocks, vorbis_comments<\/td>/, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.flac", 524288] } + ] + }, + + // ---- AAC ---- + { + name: "Extract Audio Metadata: AAC container and MIME", + input: AAC_HEX, + expectedMatch: /Container<\/td>aac<\/td>.*MIME<\/td>audio\/aac<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.aac", 524288] } + ] + }, + { + name: "Extract Audio Metadata: AAC ADTS technical fields", + input: AAC_HEX, + expectedMatch: /AAC ADTS.*mpeg_version<\/td>MPEG-4<\/td>.*profile<\/td>LC<\/td>.*sample_rate<\/td>44100<\/td>.*channel_description<\/td>stereo<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.aac", 524288] } + ] + }, + + // ---- AC3 ---- + { + name: "Extract Audio Metadata: AC3 container and MIME", + input: AC3_HEX, + expectedMatch: /Container<\/td>ac3<\/td>.*MIME<\/td>audio\/ac3<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.ac3", 524288] } + ] + }, + { + name: "Extract Audio Metadata: AC3 technical fields (sample rate, bitrate, channels)", + input: AC3_HEX, + expectedMatch: /AC3 \(Dolby Digital\).*sample_rate<\/td>44100<\/td>.*bitrate_kbps<\/td>192<\/td>.*channel_layout<\/td>2\.0 \(L R\)<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.ac3", 524288] } + ] + }, + + // ---- OGG Vorbis ---- + { + name: "Extract Audio Metadata: OGG container and common tags", + input: OGG_HEX, + expectedMatch: /Container<\/td>ogg<\/td>.*Title<\/td>Galway<\/td>.*Artist<\/td>Kevin MacLeod<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.ogg", 524288] } + ] + }, + { + name: "Extract Audio Metadata: OGG Vorbis comments (vendor, encoder)", + input: OGG_HEX, + expectedMatch: /Vorbis Comments.*Vendor<\/td>Lavf56\.40\.101<\/td>.*ENCODER<\/td>Lavc56\.60\.100 libvorbis<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.ogg", 524288] } + ] + }, + + // ---- Opus ---- + { + name: "Extract Audio Metadata: Opus container and common tags", + input: OPUS_HEX, + expectedMatch: /Container<\/td>opus<\/td>.*Title<\/td>Galway<\/td>.*Artist<\/td>Kevin MacLeod<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.opus", 524288] } + ] + }, + { + name: "Extract Audio Metadata: Opus Vorbis comments (vendor, encoder)", + input: OPUS_HEX, + expectedMatch: /Vorbis Comments.*Vendor<\/td>Lavf58\.19\.102<\/td>.*ENCODER<\/td>Lavc58\.34\.100 libopus<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.opus", 524288] } + ] + }, + + // ---- WMA/ASF ---- + { + name: "Extract Audio Metadata: WMA container and MIME", + input: WMA_HEX, + expectedMatch: /Container<\/td>wma<\/td>.*MIME<\/td>audio\/x-ms-wma<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.wma", 524288] } + ] + }, + { + name: "Extract Audio Metadata: WMA common tags (title, artist)", + input: WMA_HEX, + expectedMatch: /Title<\/td>Galway<\/td>.*Artist<\/td>Kevin MacLeod<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.wma", 524288] } + ] + }, + { + name: "Extract Audio Metadata: WMA ASF Content Description", + input: WMA_HEX, + expectedMatch: /ASF Content Description.*title<\/td>Galway<\/td>.*author<\/td>Kevin MacLeod<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.wma", 524288] } + ] + }, + { + name: "Extract Audio Metadata: WMA ASF Extended Content (encoding settings)", + input: WMA_HEX, + expectedMatch: /ASF Extended Content.*WM\/EncodingSettings<\/td>Lavf56\.40\.101<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.wma", 524288] } + ] + }, + { + name: "Extract Audio Metadata: WMA detections", + input: WMA_HEX, + expectedMatch: /Metadata systems<\/td>asf_header, asf_content_desc, asf_ext_content_desc<\/td>/, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.wma", 524288] } + ] + }, + + // ---- M4A ---- + { + name: "Extract Audio Metadata: M4A container, MIME and brand", + input: M4A_HEX, + expectedMatch: /Container<\/td>m4a<\/td>.*MIME<\/td>audio\/mp4<\/td>.*Brand<\/td>M4A <\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.m4a", 524288] } + ] + }, + { + name: "Extract Audio Metadata: M4A top-level atoms (ftyp, mdat)", + input: M4A_HEX, + expectedMatch: /MP4 Top-Level Atoms.*ftyp<\/td>.*mdat<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.m4a", 524288] } + ] + }, + + // ---- AIFF ---- + { + name: "Extract Audio Metadata: AIFF container, MIME and brand", + input: AIFF_HEX, + expectedMatch: /Container<\/td>aiff<\/td>.*MIME<\/td>audio\/aiff<\/td>.*Brand<\/td>AIFF<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.aiff", 524288] } + ] + }, + { + name: "Extract Audio Metadata: AIFF common tag (title from NAME chunk)", + input: AIFF_HEX, + expectedMatch: /Title<\/td>Galway<\/td>/, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.aiff", 524288] } + ] + }, + { + name: "Extract Audio Metadata: AIFF chunks (NAME)", + input: AIFF_HEX, + expectedMatch: /AIFF Chunks.*NAME<\/td>Galway<\/td>/s, + recipeConfig: [ + { op: "From Hex", args: ["None"] }, + { op: "Extract Audio Metadata", args: ["test.aiff", 524288] } + ] + }, +]); diff --git a/tests/samples/Audio.mjs b/tests/samples/Audio.mjs new file mode 100644 index 00000000..e792677e --- /dev/null +++ b/tests/samples/Audio.mjs @@ -0,0 +1,73 @@ +/** + * Audio file headers in various formats for use in tests. + * + * Each constant contains the minimal bytes needed for container + * detection and metadata extraction (trimmed from real audio files). + * + * @author d0s1nt [d0s1nt@cyberchefaudio] + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +/** + * MP3 with ID3v2.4 header — title: Galway, artist: Kevin MacLeod + * 78 bytes: ID3v2 header + TIT2 + TPE1 + TSSE frames + */ +export const MP3_HEX = "4944330400000000004e544954320000000800000347616c77617900545045310000000f0000034b6576696e204d61634c656f6400545353450000000f0000034c61766635362e34302e3130310000000000000000000000"; + +/** + * WAV (RIFF/WAVE) header — 2 channels, 16-bit, 44100 Hz + * 48 bytes: RIFF header + fmt chunk + data chunk start + */ +export const WAV_HEX = "52494646e69d2a0057415645666d7420100000000100020044ac000010b102000400100064617461489d2a0000000100"; + +/** + * FLAC with streaminfo + Vorbis comment block — title: Galway, artist: Kevin MacLeod + * 174 bytes: fLaC magic + STREAMINFO (34 bytes) + VORBIS_COMMENT block (86 bytes) + */ +export const FLAC_HEX = "664c6143000000221200120000052e00319f0ac442f0000aa752c925754a50e5f02e117eeb46467e7053040000560d0000004c61766635362e34302e313031030000000c0000007469746c653d47616c776179140000006172746973743d4b6576696e204d61634c656f6415000000656e636f6465723d4c61766635362e34302e313031"; + +/** + * AAC ADTS frame header — MPEG-4, LC profile, 44100 Hz, stereo + * 32 bytes: ADTS sync + frame header fields + */ +export const AAC_HEX = "fff150800bbffcde02004c61766335382e33342e31303000423590002000001e"; + +/** + * AC3 (Dolby Digital) sync frame header — 44100 Hz, 192 kbps, 2.0 stereo + * 32 bytes: AC3 sync word + BSI fields + */ +export const AC3_HEX = "0b773968544043e106f575f0d4da1c1ac159850953e549a125736e8d37359d3f"; + +/** + * OGG Vorbis — two OGG pages with identification + comment headers + * title: Galway, artist: Kevin MacLeod, vendor: Lavf56.40.101 + * 281 bytes + */ +export const OGG_HEX = "4f6767530002000000000000000027a7032a000000002acbc833011e01766f72626973000000000244ac00000000000080b5010000000000b8014f6767530000000000000000000027a7032a010000007e1abea41168ffffffffffffffffffffffffffffff0703766f726269730d0000004c61766635362e34302e313031030000001f000000656e636f6465723d4c61766335362e36302e313030206c6962766f726269730c0000007469746c653d47616c776179140000006172746973743d4b6576696e204d61634c656f64"; + +/** + * Opus — two OGG pages with OpusHead + OpusTags headers + * title: Galway, artist: Kevin MacLeod, vendor: Lavf58.19.102 + * 233 bytes + */ +export const OPUS_HEX = "4f67675300020000000000000000919a59f200000000f6117eb601134f707573486561640102380180bb00000000004f67675300000000000000000000919a59f201000000b047e56601664f707573546167730d0000004c61766635382e31392e313032030000001d000000656e636f6465723d4c61766335382e33342e313030206c69626f7075730c0000007469746c653d47616c776179140000006172746973743d4b6576696e204d61634c656f64"; + +/** + * WMA/ASF — ASF header with Content Description + Extended Content + * title: Galway, author: Kevin MacLeod, encoder: Lavf56.40.101 + * 700 bytes: ASF Header Object + all sub-objects + */ +export const WMA_HEX = "3026b2758e66cf11a6d900aa0062ce6c8a02000000000000060000000102a1dcab8c47a9cf118ee400c00c205365680000000000000000000000000000000000000000000000bc3504000000000000803ed5deb19d0156000000000000007040490b00000000b03a7009000000001c0c00000000000002000000800c0000800c000000f40100b503bf5f2ea9cf118ee300c00c2053652e0000000000000011d2d3abbaa9cf118ee600c00c2053650600000000003326b2758e66cf11a6d900aa0062ce6c4c000000000000000e001c00000000000000470061006c0077006100790000004b006500760069006e0020004d00610063004c0065006f006400000040a4d0d207e3d21197f000a0c95ea850b40000000000000003000c007400690074006c006500000000000e00470061006c0077006100790000000e0041007500740068006f007200000000001c004b006500760069006e0020004d00610063004c0065006f0064000000280057004d002f0045006e0063006f00640069006e006700530065007400740069006e0067007300000000001c004c00610076006600350036002e00340030002e0031003000310000009107dcb7b7a9cf118ee600c00c2053657200000000000000409e69f84d5bcf11a8fd00805f5c442b50cdc3bf8f61cf118bb200aa00b4e22000000000000000001c000000080000000100000000006101020044ac0000803e0000e70210000a000000000001000000000001e702e7020100004052d1861d31d011a3a400a0c90348f664000000000000004152d1861d31d011a3a400a0c90348f60100000002001700570069006e0064006f007700730020004d006500640069006100200041007500640069006f0020005600380000000000020061013626b2758e66cf11a6d900aa0062ce6c32330400000000000000000000000000000000000000000056000000000000000101"; + +/** + * M4A (MPEG-4 Audio) — ftyp atom with brand "M4A ", plus mdat + * 512 bytes: ftyp + free + mdat start (moov not included in slice) + */ +export const M4A_HEX = "0000001c667479704d344120000002004d34412069736f6d69736f3200000008667265650003e2236d6461742111450014500146fff10a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5de98214b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4bc211a93a09c3e310803595989841e21e02814c4d2f28f925da49e5fe61d4521f0088400d65662610788780a0563ab2a671af1d0cd2fd9997d18be037ff8852d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d"; + +/** + * AIFF (FORM/AIFF) header with NAME chunk = "Galway", COMM and SSND chunks + * 36 bytes: FORM header + NAME chunk + COMM chunk start + */ +export const AIFF_HEX = "464f524d002a9d84414946464e414d450000000647616c776179434f4d4d00000012000200"; From 607acbd24e6465cb6d6b725714c40524f3d4dc98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:20:03 +0000 Subject: [PATCH 018/208] chore (deps): bump the patch-updates group with 6 updates (#2260) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 48 +++++++++++++++++++++++------------------------ package.json | 10 +++++----- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index b4b293e2..4035b7ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,7 +73,7 @@ "lz4js": "^0.2.0", "markdown-it": "^14.1.1", "moment": "^2.30.1", - "moment-timezone": "^0.6.0", + "moment-timezone": "^0.6.1", "ngeohash": "^0.6.3", "node-forge": "^1.3.3", "node-md6": "^0.1.0", @@ -111,15 +111,15 @@ "@babel/eslint-parser": "^7.28.6", "@babel/plugin-syntax-import-assertions": "^7.28.6", "@babel/plugin-transform-runtime": "^7.29.0", - "@babel/preset-env": "^7.29.0", + "@babel/preset-env": "^7.29.2", "@babel/runtime": "^7.28.6", - "@codemirror/commands": "^6.10.2", + "@codemirror/commands": "^6.10.3", "@codemirror/language": "^6.12.2", "@codemirror/search": "^6.6.0", "@codemirror/state": "^6.5.4", "@codemirror/view": "^6.39.17", "autoprefixer": "^10.4.27", - "babel-loader": "^10.0.0", + "babel-loader": "^10.1.1", "base64-loader": "^1.0.0", "chromedriver": "^130.0.4", "cli-progress": "^3.12.0", @@ -154,7 +154,7 @@ "postcss-loader": "^8.2.1", "prompt": "^1.3.0", "sitemap": "^8.0.3", - "terser": "^5.46.0", + "terser": "^5.46.1", "webpack": "^5.105.4", "webpack-bundle-analyzer": "^4.10.2", "webpack-dev-server": "5.0.4", @@ -1640,9 +1640,9 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.29.0.tgz", - "integrity": "sha512-fNEdfc0yi16lt6IZo2Qxk3knHVdfMYX33czNb4v8yWhemoBhibCpQK/uYHtSKIiO+p/zd3+8fYVXhQdOVV608w==", + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.29.2.tgz", + "integrity": "sha512-DYD23veRYGvBFhcTY1iUvJnDNpuqNd/BzBwCvzOTKUnJjKg5kpUBh3/u9585Agdkgj+QuygG7jLfOPWMa2KVNw==", "dev": true, "license": "MIT", "dependencies": { @@ -1840,14 +1840,14 @@ } }, "node_modules/@codemirror/commands": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.10.2.tgz", - "integrity": "sha512-vvX1fsih9HledO1c9zdotZYUZnE4xV0m6i3m25s5DIfXofuprk6cRcLUZvSk3CASUbwjQX21tOGbkY2BH8TpnQ==", + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.10.3.tgz", + "integrity": "sha512-JFRiqhKu+bvSkDLI+rUhJwSxQxYb759W5GBezE8Uc8mHLqC9aV/9aTC7yJSqCtB3F00pylrLCwnyS91Ap5ej4Q==", "dev": true, "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", - "@codemirror/state": "^6.4.0", + "@codemirror/state": "^6.6.0", "@codemirror/view": "^6.27.0", "@lezer/common": "^1.1.0" } @@ -1880,9 +1880,9 @@ } }, "node_modules/@codemirror/state": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.4.tgz", - "integrity": "sha512-8y7xqG/hpB53l25CIoit9/ngxdfoG+fx+V3SHBrinnhOtLvKHRyAJJuHzkWrR4YXXLX8eXBsejgAAxHUOdW1yw==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.6.0.tgz", + "integrity": "sha512-4nbvra5R5EtiCzr9BTHiTLc+MLXK2QGiAVYMyi8PkQd3SR+6ixar/Q/01Fa21TBIDOZXgeWV4WppsQolSreAPQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5181,9 +5181,9 @@ } }, "node_modules/babel-loader": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-10.1.0.tgz", - "integrity": "sha512-5HTUZa013O4SWEYlJDHexrqSIYkWatfA9w/ZZQa7V2nMc0dRWkfu/0pmioC7XMYm8M7Z/3+q42NWj6e+fAT0MQ==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-10.1.1.tgz", + "integrity": "sha512-JwKSzk2kjIe7mgPK+/lyZ2QAaJcpahNAdM+hgR2HI8D0OJVkdj8Rl6J3kaLYki9pwF7P2iWnD8qVv80Lq1ABtg==", "dev": true, "license": "MIT", "dependencies": { @@ -13300,9 +13300,9 @@ } }, "node_modules/moment-timezone": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.6.0.tgz", - "integrity": "sha512-ldA5lRNm3iJCWZcBCab4pnNL3HSZYXVb/3TYr75/1WCTWYuTqYUb5f/S384pncYjJ88lbO8Z4uPDvmoluHJc8Q==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.6.1.tgz", + "integrity": "sha512-1B9lmAhB9D9/sHaPC1N7wLFEVUoFldxOpOO96lOD1PvJ43vCd0ozDPbu0FEL3++VvawOlDkq8YD373tJmP5JHw==", "license": "MIT", "dependencies": { "moment": "^2.29.4" @@ -17033,9 +17033,9 @@ "license": "MIT" }, "node_modules/terser": { - "version": "5.46.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.0.tgz", - "integrity": "sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==", + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.1.tgz", + "integrity": "sha512-vzCjQO/rgUuK9sf8VJZvjqiqiHFaZLnOiimmUuOKODxWL8mm/xua7viT7aqX7dgPY60otQjUotzFMmCB4VdmqQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { diff --git a/package.json b/package.json index 2948556e..868389b7 100644 --- a/package.json +++ b/package.json @@ -42,15 +42,15 @@ "@babel/eslint-parser": "^7.28.6", "@babel/plugin-syntax-import-assertions": "^7.28.6", "@babel/plugin-transform-runtime": "^7.29.0", - "@babel/preset-env": "^7.29.0", + "@babel/preset-env": "^7.29.2", "@babel/runtime": "^7.28.6", - "@codemirror/commands": "^6.10.2", + "@codemirror/commands": "^6.10.3", "@codemirror/language": "^6.12.2", "@codemirror/search": "^6.6.0", "@codemirror/state": "^6.5.4", "@codemirror/view": "^6.39.17", "autoprefixer": "^10.4.27", - "babel-loader": "^10.0.0", + "babel-loader": "^10.1.1", "base64-loader": "^1.0.0", "chromedriver": "^130.0.4", "cli-progress": "^3.12.0", @@ -85,7 +85,7 @@ "postcss-loader": "^8.2.1", "prompt": "^1.3.0", "sitemap": "^8.0.3", - "terser": "^5.46.0", + "terser": "^5.46.1", "webpack": "^5.105.4", "webpack-bundle-analyzer": "^4.10.2", "webpack-dev-server": "5.0.4", @@ -156,7 +156,7 @@ "lz4js": "^0.2.0", "markdown-it": "^14.1.1", "moment": "^2.30.1", - "moment-timezone": "^0.6.0", + "moment-timezone": "^0.6.1", "ngeohash": "^0.6.3", "node-forge": "^1.3.3", "node-md6": "^0.1.0", From 7f4f90e4f3c46180cfdf6d124040bb9f1d228337 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 08:44:28 +0000 Subject: [PATCH 019/208] chore (deps): bump core-js from 3.48.0 to 3.49.0 (#2261) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4035b7ff..67f2ef00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -126,7 +126,7 @@ "colors": "^1.4.0", "compression-webpack-plugin": "^11.1.0", "copy-webpack-plugin": "^13.0.1", - "core-js": "^3.48.0", + "core-js": "^3.49.0", "cspell": "^8.19.4", "css-loader": "7.1.4", "eslint": "^9.39.4", @@ -6813,9 +6813,9 @@ } }, "node_modules/core-js": { - "version": "3.48.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.48.0.tgz", - "integrity": "sha512-zpEHTy1fjTMZCKLHUZoVeylt9XrzaIN2rbPXEt0k+q7JE5CkCZdo6bNq55bn24a69CH7ErAVLKijxJja4fw+UQ==", + "version": "3.49.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.49.0.tgz", + "integrity": "sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==", "dev": true, "hasInstallScript": true, "license": "MIT", diff --git a/package.json b/package.json index 868389b7..0c7b2160 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "colors": "^1.4.0", "compression-webpack-plugin": "^11.1.0", "copy-webpack-plugin": "^13.0.1", - "core-js": "^3.48.0", + "core-js": "^3.49.0", "cspell": "^8.19.4", "css-loader": "7.1.4", "eslint": "^9.39.4", From 290f824e18f16db2efab1b533c0914ee730b77bd Mon Sep 17 00:00:00 2001 From: Roman Karwacik <108284286+rtpt-romankarwacik@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:26:39 +0100 Subject: [PATCH 020/208] feat: add Raw option for Jq operation (#2237) --- src/core/operations/Jq.mjs | 16 ++++++++++++---- tests/operations/tests/Jq.mjs | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 tests/operations/tests/Jq.mjs diff --git a/src/core/operations/Jq.mjs b/src/core/operations/Jq.mjs index c1e02b34..bc502957 100644 --- a/src/core/operations/Jq.mjs +++ b/src/core/operations/Jq.mjs @@ -30,7 +30,12 @@ class Jq extends Operation { name: "Query", type: "string", value: "" - } + }, + { + name: "Raw", + type: "boolean", + value: false + }, ]; } @@ -40,7 +45,7 @@ class Jq extends Operation { * @returns {string} */ run(input, args) { - const [query] = args; + const [query, raw] = args; let result; try { @@ -48,8 +53,11 @@ class Jq extends Operation { } catch (err) { throw new OperationError(`Invalid jq expression: ${err.message}`); } - - return JSON.stringify(result); + if (raw && typeof result === "string") { + return result; + } else { + return JSON.stringify(result); + } } } diff --git a/tests/operations/tests/Jq.mjs b/tests/operations/tests/Jq.mjs new file mode 100644 index 00000000..a2435450 --- /dev/null +++ b/tests/operations/tests/Jq.mjs @@ -0,0 +1,32 @@ +/** + * Jq tests. + * + * @author rtpt-romankarwacik [roman.karwacik@redteam-pentesting.de] + * + */ +import TestRegister from "../../lib/TestRegister.mjs"; + +TestRegister.addTests([ + { + name: "Get raw JSON Property", + input: '{"data": "testString\\u0000"}', + expectedOutput: "testString\u0000", + recipeConfig: [ + { + op: "Jq", + args: [".data", true], + }, + ], + }, + { + name: "Get JSON Property", + input: '{"data": "testString\\u0000"}', + expectedOutput: "\"testString\\u0000\"", + recipeConfig: [ + { + op: "Jq", + args: [".data", false], + }, + ], + }, +]); From 32ff3cd55ebbc9fd0ed2bce9887debd59c71f7fe Mon Sep 17 00:00:00 2001 From: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> Date: Fri, 20 Mar 2026 11:00:53 +0000 Subject: [PATCH 021/208] Bump flatted from 3.3.2 to 3.4.2 (#2266) --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67f2ef00..b03ab1f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9627,9 +9627,9 @@ } }, "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "dev": true, "license": "ISC" }, From a1f9208221a6f7df9eff08dfc612a3ff37997dfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 11:32:50 +0000 Subject: [PATCH 022/208] chore (deps): bump @codemirror/view from 6.39.17 to 6.40.0 (#2262) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index b03ab1f1..62705eb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -117,7 +117,7 @@ "@codemirror/language": "^6.12.2", "@codemirror/search": "^6.6.0", "@codemirror/state": "^6.5.4", - "@codemirror/view": "^6.39.17", + "@codemirror/view": "^6.40.0", "autoprefixer": "^10.4.27", "babel-loader": "^10.1.1", "base64-loader": "^1.0.0", @@ -1890,13 +1890,13 @@ } }, "node_modules/@codemirror/view": { - "version": "6.39.17", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.39.17.tgz", - "integrity": "sha512-Aim4lFqhbijnchl83RLfABWueSGs1oUCSv0mru91QdhpXQeNKprIdRO9LWA4cYkJvuYTKGJN7++9MXx8XW43ag==", + "version": "6.40.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.40.0.tgz", + "integrity": "sha512-WA0zdU7xfF10+5I3HhUUq3kqOx3KjqmtQ9lqZjfK7jtYk4G72YW9rezcSywpaUMCWOMlq+6E0pO1IWg1TNIhtg==", "dev": true, "license": "MIT", "dependencies": { - "@codemirror/state": "^6.5.0", + "@codemirror/state": "^6.6.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" diff --git a/package.json b/package.json index 0c7b2160..46464298 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@codemirror/language": "^6.12.2", "@codemirror/search": "^6.6.0", "@codemirror/state": "^6.5.4", - "@codemirror/view": "^6.39.17", + "@codemirror/view": "^6.40.0", "autoprefixer": "^10.4.27", "babel-loader": "^10.1.1", "base64-loader": "^1.0.0", From 8c4a55b2b18cc13205e03420e1f0bd4c0545c745 Mon Sep 17 00:00:00 2001 From: Cherry <35111165+Lamby777@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:03:45 -0400 Subject: [PATCH 023/208] Add more helpful error for when numerical ingredient is left empty (#1540) Co-authored-by: GCHQ Developer C85297 <95289555+C85297@users.noreply.github.com> --- src/core/Chef.mjs | 9 ++++++++- src/core/Ingredient.mjs | 7 +++++-- src/core/Operation.mjs | 7 ++++++- src/core/Recipe.mjs | 14 +++++++++----- 4 files changed, 28 insertions(+), 9 deletions(-) mode change 100755 => 100644 src/core/Ingredient.mjs diff --git a/src/core/Chef.mjs b/src/core/Chef.mjs index ab8f83de..5be10868 100755 --- a/src/core/Chef.mjs +++ b/src/core/Chef.mjs @@ -55,8 +55,15 @@ class Chef { progress = await recipe.execute(this.dish, progress); } catch (err) { log.error(err); + + let displayStr; + if ("displayStr" in err) { + displayStr = err.displayStr; + } else { + displayStr = err.toString(); + } error = { - displayStr: err.displayStr, + displayStr: displayStr, }; progress = err.progress; } diff --git a/src/core/Ingredient.mjs b/src/core/Ingredient.mjs old mode 100755 new mode 100644 index 319dfb15..0dd31707 --- a/src/core/Ingredient.mjs +++ b/src/core/Ingredient.mjs @@ -5,7 +5,8 @@ */ import Utils from "./Utils.mjs"; -import {fromHex} from "./lib/Hex.mjs"; +import { fromHex } from "./lib/Hex.mjs"; +import OperationError from "./errors/OperationError.mjs"; /** * The arguments to operations. @@ -119,7 +120,9 @@ class Ingredient { number = parseFloat(data); if (isNaN(number)) { const sample = Utils.truncate(data.toString(), 10); - throw "Invalid ingredient value. Not a number: " + sample; + throw new OperationError( + "Invalid ingredient value. Not a number: " + sample, + ); } return number; default: diff --git a/src/core/Operation.mjs b/src/core/Operation.mjs index 24739d3f..09058766 100755 --- a/src/core/Operation.mjs +++ b/src/core/Operation.mjs @@ -5,6 +5,7 @@ */ import Dish from "./Dish.mjs"; +import OperationError from "./errors/OperationError.mjs"; import Ingredient from "./Ingredient.mjs"; /** @@ -223,7 +224,11 @@ class Operation { */ set ingValues(ingValues) { ingValues.forEach((val, i) => { - this._ingList[i].value = val; + try { + this._ingList[i].value = val; + } catch (err) { + throw new OperationError(`Failed to set value of ingredient '${this._ingList[i].name}': ${err}`); + } }); } diff --git a/src/core/Recipe.mjs b/src/core/Recipe.mjs index 7824d1e8..b4a10e03 100755 --- a/src/core/Recipe.mjs +++ b/src/core/Recipe.mjs @@ -70,11 +70,15 @@ class Recipe { if (o instanceof Operation) { return o; } else { - const op = new modules[o.module][o.name](); - op.ingValues = o.ingValues; - op.breakpoint = o.breakpoint; - op.disabled = o.disabled; - return op; + try { + const op = new modules[o.module][o.name](); + op.ingValues = o.ingValues; + op.breakpoint = o.breakpoint; + op.disabled = o.disabled; + return op; + } catch (err) { + throw new Error(`Failed to hydrate operation '${o.name}': ${err}`); + } } }); } From 38a0adaf33194644575af7b719c135d15f84a819 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 15:23:42 +0000 Subject: [PATCH 024/208] chore (deps): bump @babel/runtime from 7.28.6 to 7.29.2 (#2263) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 62705eb7..607aeca3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -112,7 +112,7 @@ "@babel/plugin-syntax-import-assertions": "^7.28.6", "@babel/plugin-transform-runtime": "^7.29.0", "@babel/preset-env": "^7.29.2", - "@babel/runtime": "^7.28.6", + "@babel/runtime": "^7.29.2", "@codemirror/commands": "^6.10.3", "@codemirror/language": "^6.12.2", "@codemirror/search": "^6.6.0", @@ -1754,9 +1754,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz", - "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==", + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz", + "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 46464298..4c188560 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@babel/plugin-syntax-import-assertions": "^7.28.6", "@babel/plugin-transform-runtime": "^7.29.0", "@babel/preset-env": "^7.29.2", - "@babel/runtime": "^7.28.6", + "@babel/runtime": "^7.29.2", "@codemirror/commands": "^6.10.3", "@codemirror/language": "^6.12.2", "@codemirror/search": "^6.6.0", From 2b370b9616f14eacee5db15096dd69445ed0ef84 Mon Sep 17 00:00:00 2001 From: j264415 <128609898+j264415@users.noreply.github.com> Date: Sat, 21 Mar 2026 17:49:13 +0000 Subject: [PATCH 025/208] Selection and Deselection of autobake checkbox using keyboard (#1727) --- src/web/Manager.mjs | 1 + src/web/waiters/ControlsWaiter.mjs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/web/Manager.mjs b/src/web/Manager.mjs index ae972a59..7cde638d 100755 --- a/src/web/Manager.mjs +++ b/src/web/Manager.mjs @@ -130,6 +130,7 @@ class Manager { // Controls document.getElementById("bake").addEventListener("click", this.controls.bakeClick.bind(this.controls)); document.getElementById("auto-bake").addEventListener("change", this.controls.autoBakeChange.bind(this.controls)); + document.getElementById("auto-bake").addEventListener("keydown", this.controls.autoBakeKeyboardHandler.bind(this.controls)); document.getElementById("step").addEventListener("click", this.controls.stepClick.bind(this.controls)); document.getElementById("clr-recipe").addEventListener("click", this.controls.clearRecipeClick.bind(this.controls)); document.getElementById("save").addEventListener("click", this.controls.saveClick.bind(this.controls)); diff --git a/src/web/waiters/ControlsWaiter.mjs b/src/web/waiters/ControlsWaiter.mjs index b57940a3..d281fb89 100755 --- a/src/web/waiters/ControlsWaiter.mjs +++ b/src/web/waiters/ControlsWaiter.mjs @@ -57,6 +57,18 @@ class ControlsWaiter { } } + /** + * Checks or unchecks the Auto Bake checkbox with "Enter" + * @param {Event} ev + */ + autoBakeKeyboardHandler(ev) { + const checkBox = document.getElementById("auto-bake"); + ev.preventDefault(); + if (ev.key === "Enter" || ev.key === " ") { + checkBox.checked = !checkBox.checked; + } + } + /** * Handler to trigger baking. From 78d40eab60a46066e1d6bf5e50e7afa9432c162d Mon Sep 17 00:00:00 2001 From: Ted Kruijff Date: Sat, 21 Mar 2026 19:15:29 +0100 Subject: [PATCH 026/208] Add Parse Ethernet frame Operation, allow Parse IPv4 Header to cascade (#1722) --- src/core/config/Categories.json | 1 + src/core/operations/ParseEthernetFrame.mjs | 115 ++++++++++++++++++ src/core/operations/ParseIPv4Header.mjs | 29 ++++- tests/browser/02_ops.js | 2 +- tests/operations/index.mjs | 1 + tests/operations/tests/ParseEthernetFrame.mjs | 45 +++++++ 6 files changed, 186 insertions(+), 7 deletions(-) create mode 100644 src/core/operations/ParseEthernetFrame.mjs create mode 100644 tests/operations/tests/ParseEthernetFrame.mjs diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index 88cb6dc1..a2bd2d08 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -249,6 +249,7 @@ "DNS over HTTPS", "Strip HTTP headers", "Dechunk HTTP response", + "Parse Ethernet frame", "Parse User Agent", "Parse IP range", "Parse IPv6 address", diff --git a/src/core/operations/ParseEthernetFrame.mjs b/src/core/operations/ParseEthernetFrame.mjs new file mode 100644 index 00000000..9dac5d57 --- /dev/null +++ b/src/core/operations/ParseEthernetFrame.mjs @@ -0,0 +1,115 @@ +/** + * @author tedk [tedk@ted.do] + * @copyright Crown Copyright 2024 + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import OperationError from "../errors/OperationError.mjs"; +import Utils from "../Utils.mjs"; +import {fromHex, toHex} from "../lib/Hex.mjs"; + +/** + * Parse Ethernet frame operation + */ +class ParseEthernetFrame extends Operation { + + /** + * ParseEthernetFrame constructor + */ + constructor() { + super(); + + this.name = "Parse Ethernet frame"; + this.module = "Default"; + this.description = "Parses an Ethernet frame and either shows the deduced values (Source and destination MAC, VLANs) or returns the packet data.

Good for use in conjunction with the Parse IPv4, and Parse TCP/UDP recipes."; + this.infoURL = "https://en.wikipedia.org/wiki/Ethernet_frame#Frame_%E2%80%93_data_link_layer"; + this.inputType = "string"; + this.outputType = "html"; + this.args = [ + { + name: "Input type", + type: "option", + value: [ + "Raw", "Hex" + ], + defaultIndex: 0, + }, + { + name: "Return type", + type: "option", + value: [ + "Text output", "Packet data", "Packet data (hex)", + ], + defaultIndex: 0, + } + ]; + } + + + /** + * @param {string} input + * @param {Object[]} args + * @returns {html} + */ + run(input, args) { + const format = args[0]; + const outputFormat = args[1]; + + if (format === "Hex") { + input = fromHex(input); + } else if (format === "Raw") { + input = new Uint8Array(Utils.strToArrayBuffer(input)); + } else { + throw new OperationError("Invalid input format selected."); + } + + const destinationMac = input.slice(0, 6); + const sourceMac = input.slice(6, 12); + + let offset = 12; + const vlans = []; + + while (offset < input.length) { + const ethType = Utils.byteArrayToChars(input.slice(offset, offset+2)); + offset += 2; + + + if (ethType === "\x08\x00") { + break; + } else if (ethType === "\x81\x00" || ethType === "\x88\xA8") { + // Parse the VLAN tag: + // [0000] 0000 0000 0000 + // ^^^ PRIO - Ignored + // ^ DEI - Ignored + // ^^^^ ^^^^ ^^^^ VLAN ID + const vlanTag = input.slice(offset+2, offset+4); + vlans.push((vlanTag[0] & 0b00001111) << 4 | vlanTag[1]); + + offset += 2; + } else { + break; + } + } + + const packetData = input.slice(offset); + + if (outputFormat === "Packet data") { + return Utils.byteArrayToChars(packetData); + } else if (outputFormat === "Packet data (hex)") { + return toHex(packetData); + } else if (outputFormat === "Text output") { + let retval = `Source MAC: ${toHex(sourceMac, ":")}\nDestination MAC: ${toHex(destinationMac, ":")}\n`; + if (vlans.length > 0) { + retval += `VLAN: ${vlans.join(", ")}\n`; + } + retval += `Data:\n${toHex(packetData)}`; + return retval; + } + + } + + +} + +export default ParseEthernetFrame; diff --git a/src/core/operations/ParseIPv4Header.mjs b/src/core/operations/ParseIPv4Header.mjs index 84351cdc..4eed5d46 100644 --- a/src/core/operations/ParseIPv4Header.mjs +++ b/src/core/operations/ParseIPv4Header.mjs @@ -33,6 +33,12 @@ class ParseIPv4Header extends Operation { "name": "Input format", "type": "option", "value": ["Hex", "Raw"] + }, + { + "name": "Output format", + "type": "option", + "value": ["Table", "Data (hex)", "Data (raw)"], + defaultIndex: 0, } ]; } @@ -44,6 +50,8 @@ class ParseIPv4Header extends Operation { */ run(input, args) { const format = args[0]; + const outputFormat = args[1]; + let output; if (format === "Hex") { @@ -98,7 +106,10 @@ class ParseIPv4Header extends Operation { checksumResult = givenChecksum + " (incorrect, should be " + correctChecksum + ")"; } - output = ` + const data = input.slice(ihl * 4); + + if (outputFormat === "Table") { + output = `
FieldValue
@@ -116,13 +127,19 @@ class ParseIPv4Header extends Operation { -`; + +`; - if (ihl > 5) { - output += ``; + if (ihl > 5) { + output += ``; + } + + return output + "
FieldValue
Version${version}
Internet Header Length (IHL)${ihl} (${ihl * 4} bytes)
Differentiated Services Code Point (DSCP)${dscp}
Protocol${protocol}, ${protocolInfo.protocol} (${protocolInfo.keyword})
Header checksum${checksumResult}
Source IP address${ipv4ToStr(srcIP)}
Destination IP address${ipv4ToStr(dstIP)}
Destination IP address${ipv4ToStr(dstIP)}
Data (hex)${toHex(data)}
Options${toHex(options)}
Options${toHex(options)}
"; + } else if (outputFormat === "Data (hex)") { + return toHex(data); + } else if (outputFormat === "Data (raw)") { + return Utils.byteArrayToChars(data); } - - return output + ""; } } diff --git a/tests/browser/02_ops.js b/tests/browser/02_ops.js index dde84f68..5ab55451 100644 --- a/tests/browser/02_ops.js +++ b/tests/browser/02_ops.js @@ -268,7 +268,7 @@ module.exports = { testOpHtml(browser, "Parse colour code", "#000", ".colorpicker-preview", "rgb(0, 0, 0)"); testOpHtml(browser, "Parse DateTime", "01/12/2000 13:00:00", "", /Date: Friday 1st December 2000/); // testOp(browser, "Parse IP range", "test input", "test_output"); - testOpHtml(browser, "Parse IPv4 header", "45 c0 00 c4 02 89 00 00 ff 11 1e 8c c0 a8 0c 01 c0 a8 0c 02", "tr:last-child td:last-child", "192.168.12.2"); + testOpHtml(browser, "Parse IPv4 header", "45 c0 00 c4 02 89 00 00 ff 11 1e 8c c0 a8 0c 01 c0 a8 0c 02", "tr:nth-last-child(2) td:last-child", "192.168.12.2"); // testOp(browser, "Parse IPv6 address", "test input", "test_output"); // testOp(browser, "Parse ObjectID timestamp", "test input", "test_output"); // testOp(browser, "Parse QR Code", "test input", "test_output"); diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index 2134cdd9..f030349d 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -122,6 +122,7 @@ import "./tests/NetBIOS.mjs"; import "./tests/NormaliseUnicode.mjs"; import "./tests/NTLM.mjs"; import "./tests/OTP.mjs"; +import "./tests/ParseEthernetFrame.mjs"; import "./tests/ParseIPRange.mjs"; import "./tests/ParseObjectIDTimestamp.mjs"; import "./tests/ParseQRCode.mjs"; diff --git a/tests/operations/tests/ParseEthernetFrame.mjs b/tests/operations/tests/ParseEthernetFrame.mjs new file mode 100644 index 00000000..c849e207 --- /dev/null +++ b/tests/operations/tests/ParseEthernetFrame.mjs @@ -0,0 +1,45 @@ +/** + * Parse Ethernet frame tests. + * + * @author tedk [tedk@ted.do] + * @copyright Crown Copyright 2017 + * @license Apache-2.0 + */ +import TestRegister from "../../lib/TestRegister.mjs"; + +TestRegister.addTests([ + { + name: "Parse plain Ethernet frame", + input: "000000000000ffffffffffff08004500", + expectedOutput: "Source MAC: ff:ff:ff:ff:ff:ff\nDestination MAC: 00:00:00:00:00:00\nData:\n45 00", + recipeConfig: [ + { + "op": "Parse Ethernet frame", + "args": ["Hex", "Text output"] + } + ] + }, + // Example PCAP data from: https://packetlife.net/captures/protocol/vlan/ + { + name: "Parse Ethernet frame with one VLAN tag (802.1q)", + input: "01000ccdcdd00013c3dfae188100a0760165aaaa", + expectedOutput: "Source MAC: 00:13:c3:df:ae:18\nDestination MAC: 01:00:0c:cd:cd:d0\nVLAN: 117\nData:\naa aa", + recipeConfig: [ + { + "op": "Parse Ethernet frame", + "args": ["Hex", "Text output"] + } + ] + }, + { + name: "Parse Ethernet frame with two VLAN tags (802.1ad)", + input: "0019aa7de688002155c8f13c810000d18100001408004500", + expectedOutput: "Source MAC: 00:21:55:c8:f1:3c\nDestination MAC: 00:19:aa:7d:e6:88\nVLAN: 16, 128\nData:\n45 00", + recipeConfig: [ + { + "op": "Parse Ethernet frame", + "args": ["Hex", "Text output"] + } + ] + } +]); From 9cf82cc1a10f30146a85cf8aae8fb648831cd651 Mon Sep 17 00:00:00 2001 From: j264415 <128609898+j264415@users.noreply.github.com> Date: Sat, 21 Mar 2026 20:28:59 +0000 Subject: [PATCH 027/208] Added tab focus to top banner and navigation to About/Support Modal (#1733) --- src/web/html/index.html | 12 ++--- src/web/stylesheets/layout/_banner.css | 30 +++++++++++ src/web/stylesheets/layout/_modals.css | 5 ++ src/web/waiters/ControlsWaiter.mjs | 70 ++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 6 deletions(-) diff --git a/src/web/html/index.html b/src/web/html/index.html index 38bf7ccc..2d4de4bd 100755 --- a/src/web/html/index.html +++ b/src/web/html/index.html @@ -145,7 +145,7 @@ -
+
@@ -584,22 +584,22 @@