xploitscan-shared-rules 2.4.29 → 2.4.31

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.cjs CHANGED
@@ -230,7 +230,7 @@ __export(index_exports, {
230
230
  module.exports = __toCommonJS(index_exports);
231
231
 
232
232
  // src/version.ts
233
- var SCANNER_VERSION = "2.4.29";
233
+ var SCANNER_VERSION = "2.4.31";
234
234
 
235
235
  // src/snippet.ts
236
236
  var cacheContent = null;
@@ -10585,11 +10585,12 @@ function parseReviewResponse(text) {
10585
10585
  file = Number(candidate.file);
10586
10586
  }
10587
10587
  const index = Number(candidate.index);
10588
+ const reason = !("reason" in candidate) || candidate.reason === void 0 ? "" : candidate.reason;
10588
10589
  valid.push({
10589
10590
  index,
10590
10591
  file,
10591
10592
  verdict: candidate.verdict,
10592
- reason: typeof candidate.reason === "string" ? candidate.reason : ""
10593
+ reason
10593
10594
  });
10594
10595
  }
10595
10596
  return valid;
@@ -10688,6 +10689,9 @@ async function filterFalsePositives(findings, fileContents, budgetMs = AI_FILTER
10688
10689
  let prepared;
10689
10690
  try {
10690
10691
  const raw = target.finding;
10692
+ if (!Number.isInteger(raw.line) || raw.line < 1) {
10693
+ throw new Error("finding line");
10694
+ }
10691
10695
  const finding = {
10692
10696
  ...raw,
10693
10697
  title: promptText(raw.title),
@@ -10856,9 +10860,12 @@ async function filterFalsePositives(findings, fileContents, budgetMs = AI_FILTER
10856
10860
  continue;
10857
10861
  }
10858
10862
  const r = list[0];
10863
+ if (typeof r.reason !== "string") {
10864
+ throw new TypeError("review reason");
10865
+ }
10866
+ const reason2 = truncateChars(applySecretMasks(r.reason, secrets), MAX_FIELD_CHARS);
10859
10867
  reviewedIndices.add(target.originalIndex);
10860
10868
  if (r.verdict !== "fp") continue;
10861
- const reason2 = truncateChars(applySecretMasks(r.reason, secrets), MAX_FIELD_CHARS);
10862
10869
  if (isProtectedFromAiRemoval(target.finding)) {
10863
10870
  policyRetainedMap.set(target.originalIndex, reason2);
10864
10871
  } else {