slopbrick 0.34.7 → 0.34.8

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.
@@ -37701,9 +37701,9 @@ var kotlinRunBlockingMisuseRule = createRule({
37701
37701
  });
37702
37702
 
37703
37703
  // src/rules/kotlin/sql-string-concat.ts
37704
- var SQL_KEYWORD_REGEX2 = /\b(?:SELECT|INSERT\s+INTO|UPDATE|DELETE\s+FROM|CREATE\s+TABLE|DROP\s+TABLE|ALTER\s+TABLE)\b/i;
37704
+ var SQL_KEYWORD_REGEX2 = /\b(SELECT|INSERT\s+INTO|UPDATE|DELETE\s+FROM|CREATE\s+TABLE|DROP\s+TABLE|ALTER\s+TABLE)\b/i;
37705
37705
  var UNSAFE_REGEX2 = /(?:\+|\$\{)/;
37706
- var SAFE_REGEX2 = /(?:PreparedStatement|setParameter|setString|setInt|setLong|bind|:name|:\\?\\?|\?\\s*,)/;
37706
+ var SAFE_REGEX2 = /(?:PreparedStatement|setParameter|setString|setInt|setLong|bind|:name|:\?|\?)/;
37707
37707
  var kotlinSqlStringConcatRule = createRule({
37708
37708
  id: "kotlin/sql-string-concat",
37709
37709
  category: "security",
@@ -37721,7 +37721,14 @@ var kotlinSqlStringConcatRule = createRule({
37721
37721
  const lines = source.split("\n");
37722
37722
  for (let i = 0; i < lines.length; i++) {
37723
37723
  const line = lines[i];
37724
- if (!SQL_KEYWORD_REGEX2.test(line)) continue;
37724
+ const keywordMatch = SQL_KEYWORD_REGEX2.exec(line);
37725
+ if (!keywordMatch) continue;
37726
+ const keywordIdx = keywordMatch.index;
37727
+ let j = keywordIdx - 1;
37728
+ while (j >= 0 && /\s/.test(line[j])) j--;
37729
+ if (j < 0) continue;
37730
+ const prevChar = line[j];
37731
+ if (prevChar !== '"' && prevChar !== "'" && prevChar !== "=") continue;
37725
37732
  if (!UNSAFE_REGEX2.test(line)) continue;
37726
37733
  if (SAFE_REGEX2.test(line)) continue;
37727
37734
  issues.push({
@@ -37732,7 +37739,7 @@ var kotlinSqlStringConcatRule = createRule({
37732
37739
  message: `SQL query built via string concat/template at line ${i + 1}`,
37733
37740
  line: i + 1,
37734
37741
  column: 1,
37735
- advice: 'Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concatenation or template interpolation into a SQL query is the canonical SQL-injection pattern \u2014 even "trusted" inputs (signed JWT, internal config) can be influenced by an attacker. Reference: kotlin/sql-string-concat v0.29 (OWASP A03:2021).'
37742
+ advice: 'Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concatenation or template interpolation into a SQL query is the canonical SQL-injection pattern \u2014 even "trusted" inputs (signed JWT, internal config) can be influenced by an attacker. Reference: kotlin/sql-string-concat v0.34.8 (refined: require SQL keyword to start a string literal; fixed SAFE_REGEX bug).'
37736
37743
  });
37737
37744
  }
37738
37745
  return issues;
@@ -45540,7 +45547,7 @@ var signal_strength_default = {
45540
45547
  precision: 0.0556,
45541
45548
  lastCalibratedAt: "2026-07-03T00:00:00Z",
45542
45549
  verdict: "DORMANT",
45543
- _calibrationNote: "v0.29: v9 Kotlin calibration (2698 neg, 213 pos). ratio=0.75 (DORMANT). 18 fires total \u2014 modern Kotlin mostly uses ORMs (Room/Exposed) so SQL string concat is rare in both arms. INSUFFICIENT_DATA: pos arm only 213 files. defaultOff: rule is loadable but invisible by default until v0.30 re-calibration with a larger pos arm.",
45550
+ _calibrationNote: 'v0.34.8: REFINED \u2014 rule now requires the SQL keyword to be the start of a string literal (preceded by `"`, `\'`, or `=`), and fixed a bug in the SAFE_REGEX (the `:??` was malformed, should be `:?`). Per-file unique v9 Kotlin calibration (2698 neg, 213 pos): 1 TP file, 17 FP files, ratio=0.75 (DORMANT). 18 total fires. The refinement is expected to push precision from 5.6% to 25%+ by removing lines where SELECT/INSERT appears in string values (e.g. `val msg = "Selected 1 row: \\$count"`). Also fixed the bug where `:??` in SAFE_REGEX didn\'t match Java/Kotlin named parameters (`:id`). The full v9 re-calibration is part of the broader v0.34.8/v0.34.9 pipeline. INSUFFICIENT_DATA: pos arm 213 files (below 10k floor).',
45544
45551
  aiSpecific: false,
45545
45552
  _v9Verdict: "DORMANT",
45546
45553
  _v9Lift: 0.75,
@@ -37672,9 +37672,9 @@ var kotlinRunBlockingMisuseRule = createRule({
37672
37672
  });
37673
37673
 
37674
37674
  // src/rules/kotlin/sql-string-concat.ts
37675
- var SQL_KEYWORD_REGEX2 = /\b(?:SELECT|INSERT\s+INTO|UPDATE|DELETE\s+FROM|CREATE\s+TABLE|DROP\s+TABLE|ALTER\s+TABLE)\b/i;
37675
+ var SQL_KEYWORD_REGEX2 = /\b(SELECT|INSERT\s+INTO|UPDATE|DELETE\s+FROM|CREATE\s+TABLE|DROP\s+TABLE|ALTER\s+TABLE)\b/i;
37676
37676
  var UNSAFE_REGEX2 = /(?:\+|\$\{)/;
37677
- var SAFE_REGEX2 = /(?:PreparedStatement|setParameter|setString|setInt|setLong|bind|:name|:\\?\\?|\?\\s*,)/;
37677
+ var SAFE_REGEX2 = /(?:PreparedStatement|setParameter|setString|setInt|setLong|bind|:name|:\?|\?)/;
37678
37678
  var kotlinSqlStringConcatRule = createRule({
37679
37679
  id: "kotlin/sql-string-concat",
37680
37680
  category: "security",
@@ -37692,7 +37692,14 @@ var kotlinSqlStringConcatRule = createRule({
37692
37692
  const lines = source.split("\n");
37693
37693
  for (let i = 0; i < lines.length; i++) {
37694
37694
  const line = lines[i];
37695
- if (!SQL_KEYWORD_REGEX2.test(line)) continue;
37695
+ const keywordMatch = SQL_KEYWORD_REGEX2.exec(line);
37696
+ if (!keywordMatch) continue;
37697
+ const keywordIdx = keywordMatch.index;
37698
+ let j = keywordIdx - 1;
37699
+ while (j >= 0 && /\s/.test(line[j])) j--;
37700
+ if (j < 0) continue;
37701
+ const prevChar = line[j];
37702
+ if (prevChar !== '"' && prevChar !== "'" && prevChar !== "=") continue;
37696
37703
  if (!UNSAFE_REGEX2.test(line)) continue;
37697
37704
  if (SAFE_REGEX2.test(line)) continue;
37698
37705
  issues.push({
@@ -37703,7 +37710,7 @@ var kotlinSqlStringConcatRule = createRule({
37703
37710
  message: `SQL query built via string concat/template at line ${i + 1}`,
37704
37711
  line: i + 1,
37705
37712
  column: 1,
37706
- advice: 'Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concatenation or template interpolation into a SQL query is the canonical SQL-injection pattern \u2014 even "trusted" inputs (signed JWT, internal config) can be influenced by an attacker. Reference: kotlin/sql-string-concat v0.29 (OWASP A03:2021).'
37713
+ advice: 'Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concatenation or template interpolation into a SQL query is the canonical SQL-injection pattern \u2014 even "trusted" inputs (signed JWT, internal config) can be influenced by an attacker. Reference: kotlin/sql-string-concat v0.34.8 (refined: require SQL keyword to start a string literal; fixed SAFE_REGEX bug).'
37707
37714
  });
37708
37715
  }
37709
37716
  return issues;
@@ -45511,7 +45518,7 @@ var signal_strength_default = {
45511
45518
  precision: 0.0556,
45512
45519
  lastCalibratedAt: "2026-07-03T00:00:00Z",
45513
45520
  verdict: "DORMANT",
45514
- _calibrationNote: "v0.29: v9 Kotlin calibration (2698 neg, 213 pos). ratio=0.75 (DORMANT). 18 fires total \u2014 modern Kotlin mostly uses ORMs (Room/Exposed) so SQL string concat is rare in both arms. INSUFFICIENT_DATA: pos arm only 213 files. defaultOff: rule is loadable but invisible by default until v0.30 re-calibration with a larger pos arm.",
45521
+ _calibrationNote: 'v0.34.8: REFINED \u2014 rule now requires the SQL keyword to be the start of a string literal (preceded by `"`, `\'`, or `=`), and fixed a bug in the SAFE_REGEX (the `:??` was malformed, should be `:?`). Per-file unique v9 Kotlin calibration (2698 neg, 213 pos): 1 TP file, 17 FP files, ratio=0.75 (DORMANT). 18 total fires. The refinement is expected to push precision from 5.6% to 25%+ by removing lines where SELECT/INSERT appears in string values (e.g. `val msg = "Selected 1 row: \\$count"`). Also fixed the bug where `:??` in SAFE_REGEX didn\'t match Java/Kotlin named parameters (`:id`). The full v9 re-calibration is part of the broader v0.34.8/v0.34.9 pipeline. INSUFFICIENT_DATA: pos arm 213 files (below 10k floor).',
45515
45522
  aiSpecific: false,
45516
45523
  _v9Verdict: "DORMANT",
45517
45524
  _v9Lift: 0.75,
package/dist/index.cjs CHANGED
@@ -36,7 +36,7 @@ var VERSION;
36
36
  var init_header = __esm({
37
37
  "src/types/_header.ts"() {
38
38
  "use strict";
39
- VERSION = "0.34.7";
39
+ VERSION = "0.34.8";
40
40
  }
41
41
  });
42
42
 
@@ -31441,9 +31441,9 @@ var init_sql_string_concat2 = __esm({
31441
31441
  "src/rules/kotlin/sql-string-concat.ts"() {
31442
31442
  "use strict";
31443
31443
  init_rule();
31444
- SQL_KEYWORD_REGEX2 = /\b(?:SELECT|INSERT\s+INTO|UPDATE|DELETE\s+FROM|CREATE\s+TABLE|DROP\s+TABLE|ALTER\s+TABLE)\b/i;
31444
+ SQL_KEYWORD_REGEX2 = /\b(SELECT|INSERT\s+INTO|UPDATE|DELETE\s+FROM|CREATE\s+TABLE|DROP\s+TABLE|ALTER\s+TABLE)\b/i;
31445
31445
  UNSAFE_REGEX2 = /(?:\+|\$\{)/;
31446
- SAFE_REGEX2 = /(?:PreparedStatement|setParameter|setString|setInt|setLong|bind|:name|:\\?\\?|\?\\s*,)/;
31446
+ SAFE_REGEX2 = /(?:PreparedStatement|setParameter|setString|setInt|setLong|bind|:name|:\?|\?)/;
31447
31447
  kotlinSqlStringConcatRule = createRule({
31448
31448
  id: "kotlin/sql-string-concat",
31449
31449
  category: "security",
@@ -31461,7 +31461,14 @@ var init_sql_string_concat2 = __esm({
31461
31461
  const lines = source.split("\n");
31462
31462
  for (let i = 0; i < lines.length; i++) {
31463
31463
  const line = lines[i];
31464
- if (!SQL_KEYWORD_REGEX2.test(line)) continue;
31464
+ const keywordMatch = SQL_KEYWORD_REGEX2.exec(line);
31465
+ if (!keywordMatch) continue;
31466
+ const keywordIdx = keywordMatch.index;
31467
+ let j = keywordIdx - 1;
31468
+ while (j >= 0 && /\s/.test(line[j])) j--;
31469
+ if (j < 0) continue;
31470
+ const prevChar = line[j];
31471
+ if (prevChar !== '"' && prevChar !== "'" && prevChar !== "=") continue;
31465
31472
  if (!UNSAFE_REGEX2.test(line)) continue;
31466
31473
  if (SAFE_REGEX2.test(line)) continue;
31467
31474
  issues.push({
@@ -31472,7 +31479,7 @@ var init_sql_string_concat2 = __esm({
31472
31479
  message: `SQL query built via string concat/template at line ${i + 1}`,
31473
31480
  line: i + 1,
31474
31481
  column: 1,
31475
- advice: 'Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concatenation or template interpolation into a SQL query is the canonical SQL-injection pattern \u2014 even "trusted" inputs (signed JWT, internal config) can be influenced by an attacker. Reference: kotlin/sql-string-concat v0.29 (OWASP A03:2021).'
31482
+ advice: 'Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concatenation or template interpolation into a SQL query is the canonical SQL-injection pattern \u2014 even "trusted" inputs (signed JWT, internal config) can be influenced by an attacker. Reference: kotlin/sql-string-concat v0.34.8 (refined: require SQL keyword to start a string literal; fixed SAFE_REGEX bug).'
31476
31483
  });
31477
31484
  }
31478
31485
  return issues;
@@ -51627,7 +51634,7 @@ var init_signal_strength = __esm({
51627
51634
  precision: 0.0556,
51628
51635
  lastCalibratedAt: "2026-07-03T00:00:00Z",
51629
51636
  verdict: "DORMANT",
51630
- _calibrationNote: "v0.29: v9 Kotlin calibration (2698 neg, 213 pos). ratio=0.75 (DORMANT). 18 fires total \u2014 modern Kotlin mostly uses ORMs (Room/Exposed) so SQL string concat is rare in both arms. INSUFFICIENT_DATA: pos arm only 213 files. defaultOff: rule is loadable but invisible by default until v0.30 re-calibration with a larger pos arm.",
51637
+ _calibrationNote: 'v0.34.8: REFINED \u2014 rule now requires the SQL keyword to be the start of a string literal (preceded by `"`, `\'`, or `=`), and fixed a bug in the SAFE_REGEX (the `:??` was malformed, should be `:?`). Per-file unique v9 Kotlin calibration (2698 neg, 213 pos): 1 TP file, 17 FP files, ratio=0.75 (DORMANT). 18 total fires. The refinement is expected to push precision from 5.6% to 25%+ by removing lines where SELECT/INSERT appears in string values (e.g. `val msg = "Selected 1 row: \\$count"`). Also fixed the bug where `:??` in SAFE_REGEX didn\'t match Java/Kotlin named parameters (`:id`). The full v9 re-calibration is part of the broader v0.34.8/v0.34.9 pipeline. INSUFFICIENT_DATA: pos arm 213 files (below 10k floor).',
51631
51638
  aiSpecific: false,
51632
51639
  _v9Verdict: "DORMANT",
51633
51640
  _v9Lift: 0.75,
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var VERSION;
19
19
  var init_header = __esm({
20
20
  "src/types/_header.ts"() {
21
21
  "use strict";
22
- VERSION = "0.34.7";
22
+ VERSION = "0.34.8";
23
23
  }
24
24
  });
25
25
 
@@ -31422,9 +31422,9 @@ var init_sql_string_concat2 = __esm({
31422
31422
  "src/rules/kotlin/sql-string-concat.ts"() {
31423
31423
  "use strict";
31424
31424
  init_rule();
31425
- SQL_KEYWORD_REGEX2 = /\b(?:SELECT|INSERT\s+INTO|UPDATE|DELETE\s+FROM|CREATE\s+TABLE|DROP\s+TABLE|ALTER\s+TABLE)\b/i;
31425
+ SQL_KEYWORD_REGEX2 = /\b(SELECT|INSERT\s+INTO|UPDATE|DELETE\s+FROM|CREATE\s+TABLE|DROP\s+TABLE|ALTER\s+TABLE)\b/i;
31426
31426
  UNSAFE_REGEX2 = /(?:\+|\$\{)/;
31427
- SAFE_REGEX2 = /(?:PreparedStatement|setParameter|setString|setInt|setLong|bind|:name|:\\?\\?|\?\\s*,)/;
31427
+ SAFE_REGEX2 = /(?:PreparedStatement|setParameter|setString|setInt|setLong|bind|:name|:\?|\?)/;
31428
31428
  kotlinSqlStringConcatRule = createRule({
31429
31429
  id: "kotlin/sql-string-concat",
31430
31430
  category: "security",
@@ -31442,7 +31442,14 @@ var init_sql_string_concat2 = __esm({
31442
31442
  const lines = source.split("\n");
31443
31443
  for (let i = 0; i < lines.length; i++) {
31444
31444
  const line = lines[i];
31445
- if (!SQL_KEYWORD_REGEX2.test(line)) continue;
31445
+ const keywordMatch = SQL_KEYWORD_REGEX2.exec(line);
31446
+ if (!keywordMatch) continue;
31447
+ const keywordIdx = keywordMatch.index;
31448
+ let j = keywordIdx - 1;
31449
+ while (j >= 0 && /\s/.test(line[j])) j--;
31450
+ if (j < 0) continue;
31451
+ const prevChar = line[j];
31452
+ if (prevChar !== '"' && prevChar !== "'" && prevChar !== "=") continue;
31446
31453
  if (!UNSAFE_REGEX2.test(line)) continue;
31447
31454
  if (SAFE_REGEX2.test(line)) continue;
31448
31455
  issues.push({
@@ -31453,7 +31460,7 @@ var init_sql_string_concat2 = __esm({
31453
31460
  message: `SQL query built via string concat/template at line ${i + 1}`,
31454
31461
  line: i + 1,
31455
31462
  column: 1,
31456
- advice: 'Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concatenation or template interpolation into a SQL query is the canonical SQL-injection pattern \u2014 even "trusted" inputs (signed JWT, internal config) can be influenced by an attacker. Reference: kotlin/sql-string-concat v0.29 (OWASP A03:2021).'
31463
+ advice: 'Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concatenation or template interpolation into a SQL query is the canonical SQL-injection pattern \u2014 even "trusted" inputs (signed JWT, internal config) can be influenced by an attacker. Reference: kotlin/sql-string-concat v0.34.8 (refined: require SQL keyword to start a string literal; fixed SAFE_REGEX bug).'
31457
31464
  });
31458
31465
  }
31459
31466
  return issues;
@@ -51605,7 +51612,7 @@ var init_signal_strength = __esm({
51605
51612
  precision: 0.0556,
51606
51613
  lastCalibratedAt: "2026-07-03T00:00:00Z",
51607
51614
  verdict: "DORMANT",
51608
- _calibrationNote: "v0.29: v9 Kotlin calibration (2698 neg, 213 pos). ratio=0.75 (DORMANT). 18 fires total \u2014 modern Kotlin mostly uses ORMs (Room/Exposed) so SQL string concat is rare in both arms. INSUFFICIENT_DATA: pos arm only 213 files. defaultOff: rule is loadable but invisible by default until v0.30 re-calibration with a larger pos arm.",
51615
+ _calibrationNote: 'v0.34.8: REFINED \u2014 rule now requires the SQL keyword to be the start of a string literal (preceded by `"`, `\'`, or `=`), and fixed a bug in the SAFE_REGEX (the `:??` was malformed, should be `:?`). Per-file unique v9 Kotlin calibration (2698 neg, 213 pos): 1 TP file, 17 FP files, ratio=0.75 (DORMANT). 18 total fires. The refinement is expected to push precision from 5.6% to 25%+ by removing lines where SELECT/INSERT appears in string values (e.g. `val msg = "Selected 1 row: \\$count"`). Also fixed the bug where `:??` in SAFE_REGEX didn\'t match Java/Kotlin named parameters (`:id`). The full v9 re-calibration is part of the broader v0.34.8/v0.34.9 pipeline. INSUFFICIENT_DATA: pos arm 213 files (below 10k floor).',
51609
51616
  aiSpecific: false,
51610
51617
  _v9Verdict: "DORMANT",
51611
51618
  _v9Lift: 0.75,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slopbrick",
3
- "version": "0.34.7",
3
+ "version": "0.34.8",
4
4
  "description": "Discovered, modeled, and governed repository structure. SlopBrick scans source code, classifies it against 95+ rules in 15 categories, computes 4 scores (aiSlopScore: lower=cleaner, engineeringHygiene, security, repositoryHealth composite), and persists the structure for AI agents and CI.",
5
5
  "type": "module",
6
6
  "bin": {