xploitscan-shared-rules 2.4.29 → 2.4.30

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/dist/index.d.cts CHANGED
@@ -169,7 +169,7 @@ interface CustomRule {
169
169
  * before a scan can be saved without enough provenance to explain a changed
170
170
  * grade.
171
171
  */
172
- declare const SCANNER_VERSION = "2.4.29";
172
+ declare const SCANNER_VERSION = "2.4.30";
173
173
 
174
174
  /**
175
175
  * Line-oriented helpers shared by every rule. Pure string manipulation — no fs
package/dist/index.d.ts CHANGED
@@ -169,7 +169,7 @@ interface CustomRule {
169
169
  * before a scan can be saved without enough provenance to explain a changed
170
170
  * grade.
171
171
  */
172
- declare const SCANNER_VERSION = "2.4.29";
172
+ declare const SCANNER_VERSION = "2.4.30";
173
173
 
174
174
  /**
175
175
  * Line-oriented helpers shared by every rule. Pure string manipulation — no fs
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var SCANNER_VERSION = "2.4.29";
2
+ var SCANNER_VERSION = "2.4.30";
3
3
 
4
4
  // src/snippet.ts
5
5
  var cacheContent = null;
@@ -10358,7 +10358,9 @@ function parseReviewResponse(text) {
10358
10358
  index,
10359
10359
  file,
10360
10360
  verdict: candidate.verdict,
10361
- reason: typeof candidate.reason === "string" ? candidate.reason : ""
10361
+ // Non-strings stay non-strings. The verdict loop masks, then marks
10362
+ // reviewed. A reason that cannot be masked throws and stays unreviewed.
10363
+ reason: candidate.reason
10362
10364
  });
10363
10365
  }
10364
10366
  return valid;
@@ -10457,6 +10459,9 @@ async function filterFalsePositives(findings, fileContents, budgetMs = AI_FILTER
10457
10459
  let prepared;
10458
10460
  try {
10459
10461
  const raw = target.finding;
10462
+ if (!Number.isInteger(raw.line) || raw.line < 1) {
10463
+ throw new Error("finding line");
10464
+ }
10460
10465
  const finding = {
10461
10466
  ...raw,
10462
10467
  title: promptText(raw.title),
@@ -10625,9 +10630,12 @@ async function filterFalsePositives(findings, fileContents, budgetMs = AI_FILTER
10625
10630
  continue;
10626
10631
  }
10627
10632
  const r = list[0];
10633
+ if (typeof r.reason !== "string") {
10634
+ throw new TypeError("review reason");
10635
+ }
10636
+ const reason2 = truncateChars(applySecretMasks(r.reason, secrets), MAX_FIELD_CHARS);
10628
10637
  reviewedIndices.add(target.originalIndex);
10629
10638
  if (r.verdict !== "fp") continue;
10630
- const reason2 = truncateChars(applySecretMasks(r.reason, secrets), MAX_FIELD_CHARS);
10631
10639
  if (isProtectedFromAiRemoval(target.finding)) {
10632
10640
  policyRetainedMap.set(target.originalIndex, reason2);
10633
10641
  } else {