@profullstack/threatcrush 0.13.49 → 0.13.51

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/README.md CHANGED
@@ -42,7 +42,7 @@
42
42
 
43
43
  ---
44
44
 
45
- ThreatCrush is a security daemon that runs on your server, **reading your logs and watching inbound connections** for live attacks. It checks every nginx request against 96 OWASP CRS rules (paranoia level 1) + 1 ThreatCrush rule with CRS anomaly scoring, runs 18 detection rules over auth, web and network events, auto-bans attackers, scans your codebase, spot-checks your URLs, and alerts you in real-time.
45
+ ThreatCrush is a security daemon that runs on your server, **reading your logs and watching inbound connections** for live attacks. It checks every nginx request against 96 OWASP CRS rules (paranoia level 1) + 4 ThreatCrush rules with CRS anomaly scoring, runs 18 detection rules over auth, web and network events, auto-bans attackers, scans your codebase, spot-checks your URLs, and alerts you in real-time.
46
46
 
47
47
  ```
48
48
  $ threatcrush monitor
@@ -137,7 +137,7 @@ threatcrush store publish https://github.com/you/my-module # Publish your own
137
137
 
138
138
  | Component | What it covers |
139
139
  |-----------|----------------|
140
- | `log-watcher` | nginx access log + syslog — 96 OWASP CRS rules (PL1: SQLi, XSS, path traversal, RFI, RCE, PHP/Java injection, SSRF, scanners) + 1 ThreatCrush rule (OS files in the path) scored on every request |
140
+ | `log-watcher` | nginx access log + syslog — 96 OWASP CRS rules (PL1: SQLi, XSS, path traversal, RFI, RCE, PHP/Java injection, SSRF, scanners) + 4 ThreatCrush rules (OS files in the path; PHPUnit, ThinkPHP and XWiki RCE probes) scored on every request |
141
141
  | `ssh-guard` | auth.log / secure — failed logins, brute force, root logins, user enumeration |
142
142
  | `user-journal` | journald — the systemd journal |
143
143
  | `network-monitor` | Inbound connections to your listening ports — port scans, SYN floods |
package/dist/daemon.js CHANGED
@@ -7,7 +7,11 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __commonJS = (cb, mod) => function __require() {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ try {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ } catch (e) {
13
+ throw mod = 0, e;
14
+ }
11
15
  };
12
16
  var __copyProps = (to, from, except, desc) => {
13
17
  if (from && typeof from === "object" || typeof from === "function") {
@@ -8555,6 +8559,74 @@ var THREATCRUSH_RULES = [
8555
8559
  "flags": "i",
8556
8560
  "negated": false
8557
8561
  }
8562
+ },
8563
+ {
8564
+ "id": 10002,
8565
+ "msg": "PHPUnit eval-stdin.php remote code execution probe (CVE-2017-9841)",
8566
+ "severity": "CRITICAL",
8567
+ "tags": [
8568
+ "attack-rce",
8569
+ "threatcrush",
8570
+ "cve-2017-9841"
8571
+ ],
8572
+ "targets": [
8573
+ "REQUEST_FILENAME"
8574
+ ],
8575
+ "transforms": [
8576
+ "utf8toUnicode",
8577
+ "urlDecodeUni",
8578
+ "normalizePathWin"
8579
+ ],
8580
+ "op": {
8581
+ "type": "rx",
8582
+ "source": "/src/util/php/eval-stdin\\.php",
8583
+ "flags": "i",
8584
+ "negated": false
8585
+ }
8586
+ },
8587
+ {
8588
+ "id": 10003,
8589
+ "msg": "ThinkPHP namespace routing remote code execution probe",
8590
+ "severity": "CRITICAL",
8591
+ "tags": [
8592
+ "attack-rce",
8593
+ "threatcrush",
8594
+ "cve-2022-47945"
8595
+ ],
8596
+ "targets": [
8597
+ "ARGS"
8598
+ ],
8599
+ "transforms": [
8600
+ "urlDecodeUni"
8601
+ ],
8602
+ "op": {
8603
+ "type": "rx",
8604
+ "source": "\\\\think\\\\(?:app|container|request|module|template\\\\driver\\\\file)\\b",
8605
+ "flags": "i",
8606
+ "negated": false
8607
+ }
8608
+ },
8609
+ {
8610
+ "id": 10004,
8611
+ "msg": "XWiki macro injection remote code execution probe (CVE-2025-24893)",
8612
+ "severity": "CRITICAL",
8613
+ "tags": [
8614
+ "attack-rce",
8615
+ "threatcrush",
8616
+ "cve-2025-24893"
8617
+ ],
8618
+ "targets": [
8619
+ "ARGS"
8620
+ ],
8621
+ "transforms": [
8622
+ "urlDecodeUni"
8623
+ ],
8624
+ "op": {
8625
+ "type": "rx",
8626
+ "source": "\\{\\{\\s*(?:groovy|python|async|velocity)\\b",
8627
+ "flags": "i",
8628
+ "negated": false
8629
+ }
8558
8630
  }
8559
8631
  ];
8560
8632
 
@@ -11580,11 +11652,43 @@ async function cloudFetch(path, init = {}) {
11580
11652
  var import_node_fs19 = require("fs");
11581
11653
  var import_node_path13 = require("path");
11582
11654
 
11583
- // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
11655
+ // ../../node_modules/.pnpm/chalk@6.0.1/node_modules/chalk/source/utilities.js
11656
+ function stringReplaceAll(string, substring, postfix) {
11657
+ let index = string.indexOf(substring);
11658
+ if (index === -1) {
11659
+ return string;
11660
+ }
11661
+ const substringLength = substring.length;
11662
+ let endIndex = 0;
11663
+ let returnValue = "";
11664
+ do {
11665
+ returnValue += string.slice(endIndex, index) + substring + postfix;
11666
+ endIndex = index + substringLength;
11667
+ index = string.indexOf(substring, endIndex);
11668
+ } while (index !== -1);
11669
+ returnValue += string.slice(endIndex);
11670
+ return returnValue;
11671
+ }
11672
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
11673
+ let endIndex = 0;
11674
+ let returnValue = "";
11675
+ do {
11676
+ const isGotCR = string[index - 1] === "\r";
11677
+ returnValue += string.slice(endIndex, isGotCR ? index - 1 : index) + prefix + (isGotCR ? "\r\n" : "\n") + postfix;
11678
+ endIndex = index + 1;
11679
+ index = string.indexOf("\n", endIndex);
11680
+ } while (index !== -1);
11681
+ returnValue += string.slice(endIndex);
11682
+ return returnValue;
11683
+ }
11684
+
11685
+ // ../../node_modules/.pnpm/chalk@6.0.1/node_modules/chalk/source/vendor/ansi-styles/index.js
11584
11686
  var ANSI_BACKGROUND_OFFSET = 10;
11687
+ var ANSI_UNDERLINE_OFFSET = 20;
11585
11688
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
11586
11689
  var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
11587
11690
  var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
11691
+ var wrapUnderlineAnsi = (code) => `\x1B[58;5;${code < 90 ? code - 30 : code - 90 + 8}m`;
11588
11692
  var styles = {
11589
11693
  modifier: {
11590
11694
  reset: [0, 0],
@@ -11593,6 +11697,11 @@ var styles = {
11593
11697
  dim: [2, 22],
11594
11698
  italic: [3, 23],
11595
11699
  underline: [4, 24],
11700
+ // Extended underline styles (`SGR 4:x` sub-parameters). Not in upstream `ansi-styles`.
11701
+ underlineDouble: ["4:2", 24],
11702
+ underlineCurly: ["4:3", 24],
11703
+ underlineDotted: ["4:4", 24],
11704
+ underlineDashed: ["4:5", 24],
11596
11705
  overline: [53, 55],
11597
11706
  inverse: [7, 27],
11598
11707
  hidden: [8, 28],
@@ -11643,11 +11752,36 @@ var styles = {
11643
11752
  bgMagentaBright: [105, 49],
11644
11753
  bgCyanBright: [106, 49],
11645
11754
  bgWhiteBright: [107, 49]
11755
+ },
11756
+ // Underline color (`SGR 58`/`59`). Not in upstream `ansi-styles`.
11757
+ underlineColor: {
11758
+ underlineBlack: ["58;5;0", 59],
11759
+ underlineRed: ["58;5;1", 59],
11760
+ underlineGreen: ["58;5;2", 59],
11761
+ underlineYellow: ["58;5;3", 59],
11762
+ underlineBlue: ["58;5;4", 59],
11763
+ underlineMagenta: ["58;5;5", 59],
11764
+ underlineCyan: ["58;5;6", 59],
11765
+ underlineWhite: ["58;5;7", 59],
11766
+ // Bright color
11767
+ underlineBlackBright: ["58;5;8", 59],
11768
+ underlineGray: ["58;5;8", 59],
11769
+ // Alias of `underlineBlackBright`
11770
+ underlineGrey: ["58;5;8", 59],
11771
+ // Alias of `underlineBlackBright`
11772
+ underlineRedBright: ["58;5;9", 59],
11773
+ underlineGreenBright: ["58;5;10", 59],
11774
+ underlineYellowBright: ["58;5;11", 59],
11775
+ underlineBlueBright: ["58;5;12", 59],
11776
+ underlineMagentaBright: ["58;5;13", 59],
11777
+ underlineCyanBright: ["58;5;14", 59],
11778
+ underlineWhiteBright: ["58;5;15", 59]
11646
11779
  }
11647
11780
  };
11648
11781
  var modifierNames = Object.keys(styles.modifier);
11649
11782
  var foregroundColorNames = Object.keys(styles.color);
11650
11783
  var backgroundColorNames = Object.keys(styles.bgColor);
11784
+ var underlineColorNames = Object.keys(styles.underlineColor);
11651
11785
  var colorNames = [...foregroundColorNames, ...backgroundColorNames];
11652
11786
  function assembleStyles() {
11653
11787
  const codes = /* @__PURE__ */ new Map();
@@ -11658,7 +11792,7 @@ function assembleStyles() {
11658
11792
  close: `\x1B[${style[1]}m`
11659
11793
  };
11660
11794
  group[styleName] = styles[styleName];
11661
- codes.set(style[0], style[1]);
11795
+ codes.set(Number.parseInt(style[0], 10), style[1]);
11662
11796
  }
11663
11797
  Object.defineProperty(styles, groupName, {
11664
11798
  value: group,
@@ -11671,12 +11805,16 @@ function assembleStyles() {
11671
11805
  });
11672
11806
  styles.color.close = "\x1B[39m";
11673
11807
  styles.bgColor.close = "\x1B[49m";
11808
+ styles.underlineColor.close = "\x1B[59m";
11674
11809
  styles.color.ansi = wrapAnsi16();
11675
11810
  styles.color.ansi256 = wrapAnsi256();
11676
11811
  styles.color.ansi16m = wrapAnsi16m();
11677
11812
  styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
11678
11813
  styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
11679
11814
  styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
11815
+ styles.underlineColor.ansi = wrapUnderlineAnsi;
11816
+ styles.underlineColor.ansi256 = wrapAnsi256(ANSI_UNDERLINE_OFFSET);
11817
+ styles.underlineColor.ansi16m = wrapAnsi16m(ANSI_UNDERLINE_OFFSET);
11680
11818
  Object.defineProperties(styles, {
11681
11819
  rgbToAnsi256: {
11682
11820
  value(red, green, blue) {
@@ -11695,7 +11833,7 @@ function assembleStyles() {
11695
11833
  },
11696
11834
  hexToRgb: {
11697
11835
  value(hex) {
11698
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
11836
+ const matches = /[\da-f]{6}|[\da-f]{3}/i.exec(hex.toString(16));
11699
11837
  if (!matches) {
11700
11838
  return [0, 0, 0];
11701
11839
  }
@@ -11705,7 +11843,7 @@ function assembleStyles() {
11705
11843
  }
11706
11844
  const integer = Number.parseInt(colorString, 16);
11707
11845
  return [
11708
- /* eslint-disable no-bitwise */
11846
+ /* eslint-disable no-bitwise -- We need the speed */
11709
11847
  integer >> 16 & 255,
11710
11848
  integer >> 8 & 255,
11711
11849
  integer & 255
@@ -11766,7 +11904,7 @@ function assembleStyles() {
11766
11904
  var ansiStyles = assembleStyles();
11767
11905
  var ansi_styles_default = ansiStyles;
11768
11906
 
11769
- // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
11907
+ // ../../node_modules/.pnpm/chalk@6.0.1/node_modules/chalk/source/vendor/supports-color/index.js
11770
11908
  var import_node_process = __toESM(require("process"), 1);
11771
11909
  var import_node_os3 = __toESM(require("os"), 1);
11772
11910
  var import_node_tty = __toESM(require("tty"), 1);
@@ -11783,16 +11921,23 @@ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || has
11783
11921
  } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
11784
11922
  flagForceColor = 1;
11785
11923
  }
11924
+ function hasNumericForceColor() {
11925
+ return /^\d+$/.test(env.FORCE_COLOR);
11926
+ }
11786
11927
  function envForceColor() {
11787
- if ("FORCE_COLOR" in env) {
11788
- if (env.FORCE_COLOR === "true") {
11789
- return 1;
11790
- }
11791
- if (env.FORCE_COLOR === "false") {
11792
- return 0;
11793
- }
11794
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
11928
+ if (!("FORCE_COLOR" in env)) {
11929
+ return;
11795
11930
  }
11931
+ if (env.FORCE_COLOR === "false") {
11932
+ return 0;
11933
+ }
11934
+ if (env.FORCE_COLOR === "true" || env.FORCE_COLOR.length === 0) {
11935
+ return 1;
11936
+ }
11937
+ if (!hasNumericForceColor()) {
11938
+ return;
11939
+ }
11940
+ return Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
11796
11941
  }
11797
11942
  function translateLevel(level) {
11798
11943
  if (level === 0) {
@@ -11822,6 +11967,9 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
11822
11967
  return 2;
11823
11968
  }
11824
11969
  }
11970
+ if (forceColor !== void 0 && hasNumericForceColor()) {
11971
+ return forceColor;
11972
+ }
11825
11973
  if ("TF_BUILD" in env && "AGENT_NAME" in env) {
11826
11974
  return 1;
11827
11975
  }
@@ -11849,7 +11997,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
11849
11997
  return min;
11850
11998
  }
11851
11999
  if ("TEAMCITY_VERSION" in env) {
11852
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
12000
+ return /^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
11853
12001
  }
11854
12002
  if (env.COLORTERM === "truecolor") {
11855
12003
  return 3;
@@ -11864,7 +12012,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
11864
12012
  return 3;
11865
12013
  }
11866
12014
  if ("TERM_PROGRAM" in env) {
11867
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
12015
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".", 1)[0], 10);
11868
12016
  switch (env.TERM_PROGRAM) {
11869
12017
  case "iTerm.app": {
11870
12018
  return version >= 3 ? 3 : 2;
@@ -11874,7 +12022,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
11874
12022
  }
11875
12023
  }
11876
12024
  }
11877
- if (/-256(color)?$/i.test(env.TERM)) {
12025
+ if (/-256(?:color)?$/i.test(env.TERM)) {
11878
12026
  return 2;
11879
12027
  }
11880
12028
  if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
@@ -11898,54 +12046,34 @@ var supportsColor = {
11898
12046
  };
11899
12047
  var supports_color_default = supportsColor;
11900
12048
 
11901
- // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
11902
- function stringReplaceAll(string, substring, replacer) {
11903
- let index = string.indexOf(substring);
11904
- if (index === -1) {
11905
- return string;
11906
- }
11907
- const substringLength = substring.length;
11908
- let endIndex = 0;
11909
- let returnValue = "";
11910
- do {
11911
- returnValue += string.slice(endIndex, index) + substring + replacer;
11912
- endIndex = index + substringLength;
11913
- index = string.indexOf(substring, endIndex);
11914
- } while (index !== -1);
11915
- returnValue += string.slice(endIndex);
11916
- return returnValue;
11917
- }
11918
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
11919
- let endIndex = 0;
11920
- let returnValue = "";
11921
- do {
11922
- const gotCR = string[index - 1] === "\r";
11923
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
11924
- endIndex = index + 1;
11925
- index = string.indexOf("\n", endIndex);
11926
- } while (index !== -1);
11927
- returnValue += string.slice(endIndex);
11928
- return returnValue;
11929
- }
11930
-
11931
- // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
12049
+ // ../../node_modules/.pnpm/chalk@6.0.1/node_modules/chalk/source/index.js
11932
12050
  var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
11933
12051
  var GENERATOR = /* @__PURE__ */ Symbol("GENERATOR");
11934
12052
  var STYLER = /* @__PURE__ */ Symbol("STYLER");
11935
12053
  var IS_EMPTY = /* @__PURE__ */ Symbol("IS_EMPTY");
11936
- var levelMapping = [
11937
- "ansi",
11938
- "ansi",
11939
- "ansi256",
11940
- "ansi16m"
11941
- ];
12054
+ var LEVEL = /* @__PURE__ */ Symbol("LEVEL");
11942
12055
  var styles2 = /* @__PURE__ */ Object.create(null);
12056
+ var assertValidLevel = (level) => {
12057
+ if (!Number.isSafeInteger(level) || level < 0 || level > 3) {
12058
+ throw new Error("The `level` should be an integer from 0 to 3");
12059
+ }
12060
+ };
12061
+ var levelDescriptor = {
12062
+ enumerable: true,
12063
+ get() {
12064
+ return this[LEVEL];
12065
+ },
12066
+ set(level) {
12067
+ assertValidLevel(level);
12068
+ this[LEVEL] = level;
12069
+ }
12070
+ };
11943
12071
  var applyOptions = (object, options = {}) => {
11944
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
11945
- throw new Error("The `level` option should be an integer from 0 to 3");
12072
+ if (options.level !== void 0) {
12073
+ assertValidLevel(options.level);
11946
12074
  }
11947
12075
  const colorLevel = stdoutColor ? stdoutColor.level : 0;
11948
- object.level = options.level === void 0 ? colorLevel : options.level;
12076
+ object[LEVEL] = options.level === void 0 ? colorLevel : options.level;
11949
12077
  };
11950
12078
  var chalkFactory = (options) => {
11951
12079
  const chalk2 = (...strings) => strings.join(" ");
@@ -11973,56 +12101,59 @@ styles2.visible = {
11973
12101
  return builder;
11974
12102
  }
11975
12103
  };
11976
- var getModelAnsi = (model, level, type, ...arguments_) => {
12104
+ var createModelConverters = (model, type) => {
12105
+ const style = ansi_styles_default[type];
11977
12106
  if (model === "rgb") {
11978
- if (level === "ansi16m") {
11979
- return ansi_styles_default[type].ansi16m(...arguments_);
11980
- }
11981
- if (level === "ansi256") {
11982
- return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
11983
- }
11984
- return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
12107
+ const ansi2 = (red, green, blue) => style.ansi(ansi_styles_default.rgbToAnsi(red, green, blue));
12108
+ const ansi256 = (red, green, blue) => style.ansi256(ansi_styles_default.rgbToAnsi256(red, green, blue));
12109
+ return [ansi2, ansi2, ansi256, style.ansi16m];
11985
12110
  }
11986
12111
  if (model === "hex") {
11987
- return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
12112
+ const ansi2 = (hex) => style.ansi(ansi_styles_default.hexToAnsi(hex));
12113
+ const ansi256 = (hex) => style.ansi256(ansi_styles_default.hexToAnsi256(hex));
12114
+ return [ansi2, ansi2, ansi256, (hex) => style.ansi16m(...ansi_styles_default.hexToRgb(hex))];
11988
12115
  }
11989
- return ansi_styles_default[type][model](...arguments_);
12116
+ const ansi = (code) => style.ansi(ansi_styles_default.ansi256ToAnsi(code));
12117
+ return [ansi, ansi, style.ansi256, style.ansi256];
11990
12118
  };
11991
12119
  var usedModels = ["rgb", "hex", "ansi256"];
11992
12120
  for (const model of usedModels) {
11993
- styles2[model] = {
11994
- get() {
11995
- const { level } = this;
11996
- return function(...arguments_) {
11997
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
11998
- return createBuilder(this, styler, this[IS_EMPTY]);
11999
- };
12000
- }
12001
- };
12002
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
12003
- styles2[bgModel] = {
12004
- get() {
12005
- const { level } = this;
12006
- return function(...arguments_) {
12007
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
12008
- return createBuilder(this, styler, this[IS_EMPTY]);
12009
- };
12010
- }
12011
- };
12121
+ const capitalizedModel = model[0].toUpperCase() + model.slice(1);
12122
+ for (const [styleName, type] of [
12123
+ [model, "color"],
12124
+ ["bg" + capitalizedModel, "bgColor"],
12125
+ ["underline" + capitalizedModel, "underlineColor"]
12126
+ ]) {
12127
+ const { close } = ansi_styles_default[type];
12128
+ const converters = createModelConverters(model, type);
12129
+ styles2[styleName] = {
12130
+ get() {
12131
+ const styleFunction = function(first, second, third) {
12132
+ const open = converters[this.level](first, second, third);
12133
+ return createBuilder(this, createStyler(open, close, this[STYLER]), this[IS_EMPTY]);
12134
+ };
12135
+ Object.defineProperty(this, styleName, { value: styleFunction });
12136
+ return styleFunction;
12137
+ }
12138
+ };
12139
+ }
12012
12140
  }
12013
- var proto = Object.defineProperties(() => {
12014
- }, {
12015
- ...styles2,
12016
- level: {
12017
- enumerable: true,
12018
- get() {
12019
- return this[GENERATOR].level;
12020
- },
12021
- set(level) {
12022
- this[GENERATOR].level = level;
12141
+ var proto = Object.defineProperties(
12142
+ () => {
12143
+ },
12144
+ {
12145
+ ...styles2,
12146
+ level: {
12147
+ enumerable: true,
12148
+ get() {
12149
+ return this[GENERATOR].level;
12150
+ },
12151
+ set(level) {
12152
+ this[GENERATOR].level = level;
12153
+ }
12023
12154
  }
12024
12155
  }
12025
- });
12156
+ );
12026
12157
  var createStyler = (open, close, parent) => {
12027
12158
  let openAll;
12028
12159
  let closeAll;
@@ -12042,15 +12173,23 @@ var createStyler = (open, close, parent) => {
12042
12173
  };
12043
12174
  };
12044
12175
  var createBuilder = (self, _styler, _isEmpty) => {
12045
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
12176
+ const builder = (...arguments_) => {
12177
+ if (arguments_.length === 1) {
12178
+ return applyStyle(builder, "" + arguments_[0]);
12179
+ }
12180
+ if (arguments_.length === 2) {
12181
+ return applyStyle(builder, `${arguments_[0] ?? ""} ${arguments_[1] ?? ""}`);
12182
+ }
12183
+ return applyStyle(builder, arguments_.join(" "));
12184
+ };
12046
12185
  Object.setPrototypeOf(builder, proto);
12047
- builder[GENERATOR] = self;
12186
+ builder[GENERATOR] = self[GENERATOR] ?? self;
12048
12187
  builder[STYLER] = _styler;
12049
12188
  builder[IS_EMPTY] = _isEmpty;
12050
12189
  return builder;
12051
12190
  };
12052
12191
  var applyStyle = (self, string) => {
12053
- if (self.level <= 0 || !string) {
12192
+ if (self[GENERATOR][LEVEL] <= 0 || !string) {
12054
12193
  return self[IS_EMPTY] ? "" : string;
12055
12194
  }
12056
12195
  let styler = self[STYLER];
@@ -12070,7 +12209,7 @@ var applyStyle = (self, string) => {
12070
12209
  }
12071
12210
  return openAll + string + closeAll;
12072
12211
  };
12073
- Object.defineProperties(createChalk.prototype, styles2);
12212
+ Object.defineProperties(createChalk.prototype, { ...styles2, level: levelDescriptor });
12074
12213
  var chalk = createChalk();
12075
12214
  var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
12076
12215
  var source_default = chalk;
@@ -13119,6 +13258,43 @@ var CODE_RULES = [
13119
13258
  languages: ["javascript", "typescript"],
13120
13259
  pattern: /\[\s*['"]__proto__['"]\s*\]|\bObject\s*\.\s*assign\s*\(\s*[\w.$]*\.prototype\b|\.\s*__proto__\s*=/
13121
13260
  },
13261
+ // ── GitHub Actions ───────────────────────────────────────────────────────
13262
+ //
13263
+ // A workflow runs with the repository's secrets on every push, so writing one
13264
+ // is the shortest path from "can commit" to "has every credential". In
13265
+ // October 2026 a public repository's hidden instructions got ChatGPT's GitHub
13266
+ // connector to commit exactly that into a victim's private repository; the
13267
+ // same file arrives by a compromised maintainer token or a careless merge.
13268
+ // Both rules look for the exfiltration itself, not for secrets being used:
13269
+ // `Authorization: Bearer ${{ secrets.X }}` to the API it belongs to is the
13270
+ // whole point of a secret and stays silent.
13271
+ {
13272
+ id: "gha-all-secrets-serialized",
13273
+ inherent: true,
13274
+ title: "every repository secret serialised into one value",
13275
+ consequence: "toJSON(secrets) is the full secret store as one string. Whatever step receives it can send every credential the repository holds anywhere it likes, and the runner masks it in logs, so nobody sees it leave.",
13276
+ cwe: "CWE-200",
13277
+ severity: "high",
13278
+ languages: ["config"],
13279
+ pattern: /\btoJSON\s*\(\s*secrets\s*\)/,
13280
+ fileRequires: /^\s*runs-on\s*:/m,
13281
+ guard: false
13282
+ },
13283
+ {
13284
+ id: "gha-secret-to-collector",
13285
+ inherent: true,
13286
+ title: "workflow sends secrets to a request-capture service",
13287
+ consequence: "The step posts repository secrets to a public request catcher, which is how stolen CI credentials are collected. Treat every secret the workflow can read as leaked and rotate it.",
13288
+ cwe: "CWE-200",
13289
+ severity: "critical",
13290
+ languages: ["config"],
13291
+ pattern: /\b(?:webhook\.site|requestbin\.(?:com|net)|[\w-]+\.m\.pipedream\.net|pipedream\.net|[\w-]+\.(?:ngrok(?:-free)?\.(?:io|app|dev)|trycloudflare\.com)|[\w-]+\.(?:oast\.(?:fun|live|me|online|pro|site)|interact\.sh|burpcollaborator\.net)|beeceptor\.com|hookbin\.com|requestcatcher\.com)\b/i,
13292
+ requires: /\$\{\{\s*(?:toJSON\s*\(\s*)?secrets\b/,
13293
+ fileRequires: /^\s*runs-on\s*:/m,
13294
+ guard: false,
13295
+ guardBack: 12,
13296
+ guardForward: 4
13297
+ },
13122
13298
  // ── Shell ────────────────────────────────────────────────────────────────
13123
13299
  //
13124
13300
  // `shell` was a language the type system knew about and no rule targeted, so