From 59212dc0143b4fcec1f8d69039a32fb259043fb2 Mon Sep 17 00:00:00 2001 From: Aaron Axvig Date: Fri, 20 Mar 2026 16:13:52 -0500 Subject: [PATCH] Handle blank issue IDs --- .../expected-parsed.json | 9 ++++++ .../PAN-OS-9.1.11-h3-addressed/expected.md | 9 ++++++ .../PAN-OS-9.1.11-h3-addressed/input.html | 29 +++++++++++++++++++ .../PAN-OS-9.1.11-h3-addressed/meta.json | 3 ++ web/js/process.js | 18 +++++++----- 5 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 test/fixtures/PAN-OS-9.1.11-h3-addressed/expected-parsed.json create mode 100644 test/fixtures/PAN-OS-9.1.11-h3-addressed/expected.md create mode 100644 test/fixtures/PAN-OS-9.1.11-h3-addressed/input.html create mode 100644 test/fixtures/PAN-OS-9.1.11-h3-addressed/meta.json diff --git a/test/fixtures/PAN-OS-9.1.11-h3-addressed/expected-parsed.json b/test/fixtures/PAN-OS-9.1.11-h3-addressed/expected-parsed.json new file mode 100644 index 0000000..8f8d4b0 --- /dev/null +++ b/test/fixtures/PAN-OS-9.1.11-h3-addressed/expected-parsed.json @@ -0,0 +1,9 @@ +[ + { + "id": "BLANK-000000", + "summary": "Fixed a Denial-of-Service (DoS) vulnerability in the GlobalProtect portal and gateway ([CVE-2021-3063](https://security.paloaltonetworks.com/CVE-2021-3063)).", + "resolved": "", + "caveat": "", + "renderedHtml": "

Fixed a Denial-of-Service (DoS) vulnerability in the GlobalProtect portal and gateway (CVE-2021-3063).

\n" + } +] diff --git a/test/fixtures/PAN-OS-9.1.11-h3-addressed/expected.md b/test/fixtures/PAN-OS-9.1.11-h3-addressed/expected.md new file mode 100644 index 0000000..3f02a21 --- /dev/null +++ b/test/fixtures/PAN-OS-9.1.11-h3-addressed/expected.md @@ -0,0 +1,9 @@ +--- +type: Addressed +product: PAN-OS +version: 9.1.11-h3 +--- + +## BLANK-000000 + +Fixed a Denial-of-Service (DoS) vulnerability in the GlobalProtect portal and gateway ([CVE-2021-3063](https://security.paloaltonetworks.com/CVE-2021-3063)). \ No newline at end of file diff --git a/test/fixtures/PAN-OS-9.1.11-h3-addressed/input.html b/test/fixtures/PAN-OS-9.1.11-h3-addressed/input.html new file mode 100644 index 0000000..625500d --- /dev/null +++ b/test/fixtures/PAN-OS-9.1.11-h3-addressed/input.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + +
+
Issue ID
+
+
Description
+
+
+
+
Fixed a Denial-of-Service (DoS) vulnerability + in the GlobalProtect portal and gateway (CVE-2021-3063). +
+
diff --git a/test/fixtures/PAN-OS-9.1.11-h3-addressed/meta.json b/test/fixtures/PAN-OS-9.1.11-h3-addressed/meta.json new file mode 100644 index 0000000..959d6a3 --- /dev/null +++ b/test/fixtures/PAN-OS-9.1.11-h3-addressed/meta.json @@ -0,0 +1,3 @@ +{ + "description": "Tests the scenario where the issue ID cell contains only a dash (no ID disclosed), which should produce BLANK-000000." +} diff --git a/web/js/process.js b/web/js/process.js index 068dba7..7e2d13c 100644 --- a/web/js/process.js +++ b/web/js/process.js @@ -136,21 +136,25 @@ export function parseIssuesFromHtmlTable(htmlText, options = {}) { } const issueIdListMatch = leftCellText.match(ISSUE_ID_LIST_PREFIX_PATTERN); - if (!issueIdListMatch) { + const isBlankId = !issueIdListMatch && /^[\u2014\u2013\-]+$/.test(leftCellText.trim()); + + if (!issueIdListMatch && !isBlankId) { return; } - const issueIdListText = String(issueIdListMatch[1] || ''); - const issueIds = Array.from(issueIdListText.matchAll(new RegExp(ISSUE_ID_PATTERN.source, 'ig'))) - .map(match => String(match[1] || '').toUpperCase()) - .filter(Boolean); + const issueIds = isBlankId + ? ['BLANK-000000'] + : Array.from(String(issueIdListMatch[1] || '').matchAll(new RegExp(ISSUE_ID_PATTERN.source, 'ig'))) + .map(match => String(match[1] || '').toUpperCase()) + .filter(Boolean); if (issueIds.length === 0) { return; } - const leftCellTrailingText = normalizeWhitespace(leftCellText.slice(issueIdListMatch[0].length)); - const metadataText = leftCellTrailingText.replace(/^[-:;,.\s]+/, ''); + const metadataText = isBlankId + ? '' + : normalizeWhitespace(leftCellText.slice(issueIdListMatch[0].length)).replace(/^[-:;,.\s]+/, ''); const resolved = isResolvedMetadataText(metadataText) ? metadataText : ''; const description = rightCellText;