cyberchef 9.47.2 → 9.47.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberchef",
3
- "version": "9.47.2",
3
+ "version": "9.47.4",
4
4
  "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
5
5
  "author": "n1474335 <n1474335@gmail.com>",
6
6
  "homepage": "https://gchq.github.io/CyberChef",
@@ -7830,7 +7830,14 @@
7830
7830
  "outputType": "JSON",
7831
7831
  "flowControl": false,
7832
7832
  "manualBake": false,
7833
- "args": []
7833
+ "args": [],
7834
+ "checks": [
7835
+ {
7836
+ "pattern": "^ey([A-Za-z0-9_-]+)\\.ey([A-Za-z0-9_-]+)\\.([A-Za-z0-9_-]+)$",
7837
+ "flags": "",
7838
+ "args": []
7839
+ }
7840
+ ]
7834
7841
  },
7835
7842
  "JWT Sign": {
7836
7843
  "module": "Crypto",
@@ -26,6 +26,13 @@ class JWTDecode extends Operation {
26
26
  this.inputType = "string";
27
27
  this.outputType = "JSON";
28
28
  this.args = [];
29
+ this.checks = [
30
+ {
31
+ pattern: "^ey([A-Za-z0-9_-]+)\\.ey([A-Za-z0-9_-]+)\\.([A-Za-z0-9_-]+)$",
32
+ flags: "",
33
+ args: []
34
+ },
35
+ ];
29
36
  }
30
37
 
31
38
  /**
@@ -7,7 +7,6 @@
7
7
  import Operation from "../Operation.mjs";
8
8
  import {INFLATE_BUFFER_TYPE} from "../lib/Zlib.mjs";
9
9
  import rawinflate from "zlibjs/bin/rawinflate.min.js";
10
- import OperationError from "../errors/OperationError.mjs";
11
10
 
12
11
  const Zlib = rawinflate.Zlib;
13
12
 
@@ -83,25 +82,6 @@ class RawInflate extends Operation {
83
82
  }),
84
83
  result = new Uint8Array(inflate.decompress());
85
84
 
86
- // Raw Inflate sometimes messes up and returns nonsense like this:
87
- // ]....]....]....]....]....]....]....]....]....]....]....]....]....]...
88
- // e.g. Input data of [8b, 1d, dc, 44]
89
- // Look for the first two square brackets:
90
- if (result.length > 158 && result[0] === 93 && result[5] === 93) {
91
- // If the first two square brackets are there, check that the others
92
- // are also there. If they are, throw an error. If not, continue.
93
- let valid = false;
94
- for (let i = 0; i < 155; i += 5) {
95
- if (result[i] !== 93) {
96
- valid = true;
97
- }
98
- }
99
-
100
- if (!valid) {
101
- throw new OperationError("Error: Unable to inflate data");
102
- }
103
- }
104
- // This seems to be the easiest way...
105
85
  return result.buffer;
106
86
  }
107
87