circle-ir 3.191.0 → 3.192.0

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.
@@ -26200,6 +26200,7 @@ var LanguageSourcesPass = class {
26200
26200
  }
26201
26201
  additionalSanitizers.push(...findBashRegexAllowlistSanitizers(code));
26202
26202
  additionalSanitizers.push(...findBashRealpathPrefixGuardSanitizers(code));
26203
+ additionalSanitizers.push(...findBashShellQuoteSanitizers(code));
26203
26204
  }
26204
26205
  if (language === "go") {
26205
26206
  additionalSanitizers.push(...findGoMapAllowlistGuardSanitizers(code));
@@ -27605,6 +27606,26 @@ function hasIntegrityVerifierAnywhere(lines) {
27605
27606
  }
27606
27607
  return false;
27607
27608
  }
27609
+ function findBashShellQuoteSanitizers(code) {
27610
+ const sanitizers = [];
27611
+ const lines = code.split("\n");
27612
+ const PRINTF_Q_RE = /\$\(\s*printf\s+['"]%q['"]\s+["']?\$/;
27613
+ const AT_Q_RE = /\$\{[A-Za-z_][A-Za-z0-9_]*@Q\}/;
27614
+ for (let i2 = 0; i2 < lines.length; i2++) {
27615
+ const line = lines[i2];
27616
+ if (line.trimStart().startsWith("#")) continue;
27617
+ if (!PRINTF_Q_RE.test(line) && !AT_Q_RE.test(line)) continue;
27618
+ for (let l = i2 + 1; l <= lines.length; l++) {
27619
+ sanitizers.push({
27620
+ type: "shell_quote",
27621
+ method: PRINTF_Q_RE.test(line) ? "printf '%q'" : "${var@Q}",
27622
+ line: l,
27623
+ sanitizes: ["command_injection", "code_injection"]
27624
+ });
27625
+ }
27626
+ }
27627
+ return sanitizers;
27628
+ }
27608
27629
  function findBashRegexAllowlistSanitizers(code) {
27609
27630
  const sanitizers = [];
27610
27631
  const lines = code.split("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "circle-ir",
3
- "version": "3.191.0",
3
+ "version": "3.192.0",
4
4
  "description": "High-performance Static Application Security Testing (SAST) library for detecting security vulnerabilities through taint analysis",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",