This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-website.git
The following commit(s) were added to refs/heads/main by this push:
new 7d7f3336 Fix #1877: filterable security advisories and security fixes
on release notes (#1890)
7d7f3336 is described below
commit 7d7f333606ef14b8f3fe1e075991c4ec01b6f4f9
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Nov 30 14:04:24 2026 +0100
Fix #1877: filterable security advisories and security fixes on release
notes (#1890)
* Fix #1877: filterable security advisories and security fixes on release
notes
The /security/ page listed all 137 advisories in one flat table with the
affected and fixed versions only as free text, so finding the advisories
that
apply to a given release meant reading every row.
- data/security-advisories.yaml holds the structured data of each advisory:
project, components, affected version ranges and fixed versions. It is a
separate file because each CVE-*.md is signed byte for byte as
CVE-*.txt.asc, so adding front matter to a published advisory would make
it
differ from its signed text. A new advisory may carry the same fields in
its
front matter before it is signed; those take precedence.
- scripts/security-advisory-data.js parses the free text into ranges and
adds
entries for new advisories (--check fails when one is missing). The
initial
migration parsed every advisory but one: CVE-2026-47323 lists the empty
range "from 4.19.0 before 4.19.0", which is dropped. Components not named
as a summary prefix and the CVE-2018-8041 fixed version (2.21.2, per its
mitigation; the front matter says 2.21.1) were set by hand.
- /security/ gets filters for project, version, component, severity and free
text, kept in the query string. The version filter evaluates the ranges
and
says when the version's line no longer receives fixes. Each year is a
<details> section; only the newest year with advisories starts open.
- The advisories section names the supported Camel releases (computed from
the release notes' kind/eol) and links the batch announcement posts.
- Release notes list the advisories fixed in that release, matched on the
release category and the fixed versions.
- test/security-advisories-test.js checks the data against the advisory
pages
and covers the parser and the version comparison.
The advisory pages, their .txt.asc files and every other page build
byte-identical; only /security/ and the 60 release notes with fixes change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y4dDj46SB6GniXf8mX2U6
* Generate the security advisory data during the build
Publishing an advisory no longer needs an extra step. yarn build:hugo
and yarn preview:hugo run scripts/security-advisory-data.js first; it
parses every content/security/CVE-*.md and writes
data/security-advisories.yaml, which is no longer committed.
Only what the advisory text cannot say is committed, in
data/security-advisory-overrides.yaml: the hand-picked components of
32 advisories, the CVE-2018-8041 fixed-version correction and the
CVE-2026-47323 ranges. The generated data is identical to the file
committed before.
Text the parser cannot read is a build warning, not a test failure,
and the version filter keeps such an advisory visible instead of
hiding it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y4dDj46SB6GniXf8mX2U6
* Security page: label years as publication years and date each advisory
Advisories are grouped by the year they were published, which is not
always the year in the CVE id: CVE-2025-66169 was reserved in 2025 and
published on 13 Jan 2026, so it sits under 2026 and looked misplaced.
The year headings now read "Published in 2026" and each row shows its
publication date under the CVE id.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y4dDj46SB6GniXf8mX2U6
* Security overrides: component fixes from review
- CVE-2026-43866: add camel-activemq6, named in the advisory.
- CVE-2025-29891: add camel-bean and camel-exec, the sinks the advisory
names, matching CVE-2025-27636.
- CVE-2026-88789: add the extensions users declare (camel-quarkus-tika,
-xmlsecurity, -xslt, -xslt-saxon) beside camel-quarkus-support-xalan.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y4dDj46SB6GniXf8mX2U6
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
.gitignore | 2 +
.../{site-30351b85a4.css => site-037c96abfd.css} | 2 +-
antora-ui-camel/public/_/data/rev-manifest.json | 2 +-
antora-ui-camel/public/_/helpers/asset.js | 2 +-
antora-ui-camel/public/_/partials/head-styles.hbs | 2 +-
antora-ui-camel/public/_/rev-manifest | 2 +-
antora-ui-camel/src/css/release.css | 10 +
antora-ui-camel/src/css/security.css | 199 ++++++++++++++++--
assets/js/security-advisories.js | 151 ++++++++++++++
content/security/_index.md | 2 +
data/security-advisory-overrides.yaml | 91 ++++++++
layouts/partials/security/advisory-data.html | 23 ++
layouts/partials/security/fixed-in-release.html | 16 ++
layouts/partials/security/fixes-by-release.html | 17 ++
layouts/partials/security/supported-releases.html | 24 +++
layouts/release-note/single.html | 2 +
layouts/security/list.html | 159 +++++++++-----
package.json | 4 +-
scripts/security-advisory-data.js | 232 +++++++++++++++++++++
test/security-advisories-test.js | 103 +++++++++
tests/hugo/build.sh | 3 +
21 files changed, 979 insertions(+), 69 deletions(-)
diff --git a/.gitignore b/.gitignore
index 2ca050f7..e6984e47 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,8 @@ resources
.metadata
.settings
.hugo_data
+# generated by scripts/security-advisory-data.js during the build
+/data/security-advisories.yaml
.pnp
.vscode
**/.DS_Store
diff --git a/antora-ui-camel/public/_/css/site-30351b85a4.css
b/antora-ui-camel/public/_/css/site-037c96abfd.css
similarity index 77%
rename from antora-ui-camel/public/_/css/site-30351b85a4.css
rename to antora-ui-camel/public/_/css/site-037c96abfd.css
index 21fa2d89..aa97e356 100644
--- a/antora-ui-camel/public/_/css/site-30351b85a4.css
+++ b/antora-ui-camel/public/_/css/site-037c96abfd.css
@@ -20,4 +20,4 @@
.line and .cl (line wrappers), and .err (a lexer hiccup is not worth a
color). .go, generic command output, is content the reader needs rather
than chrome, so it stays at the base color too. */}@layer content{@media
screen and (width >= 1025px){.doc{font-size:.88889rem;margin:0
2rem;max-width:none;min-width:0}}.doc h1,.doc h2,.doc h3,.doc h4,.doc h5,.doc
h6{color:#211c17;font-weight:700;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;line-height:1.3;margin:1rem
0
0}.doc>h1.page,.static>h1:first-child{font-size:2.33333rem;font-weight:800;letter-spacing:-.03em;line-height:1.05;margin:.55556rem
0 0}.doc>h1.page img{width:2r [...]
-/*! Asciidoctor Tabs | Copyright (c) 2018-present Dan Allen | MIT License
*/.tablist>ul li:focus-visible{outline:none}.tablist.ulist,.tablist.ulist>ul
li{margin:0}.tablist.ulist>ul li+li{margin-left:.25em}.tabs.is-loading .tablist
li:not(:first-child),.tabs:not(.is-loading) .tablist
li:not(.is-selected){background-color:#f5f5f5}.tabs.is-loading .tablist
li:first-child::after,.tabs:not(.is-loading) .tablist
li.is-selected::after{background-color:inherit;content:"";display:block;height:3px
[...]
\ No newline at end of file
+/*! Asciidoctor Tabs | Copyright (c) 2018-present Dan Allen | MIT License
*/.tablist>ul li:focus-visible{outline:none}.tablist.ulist,.tablist.ulist>ul
li{margin:0}.tablist.ulist>ul li+li{margin-left:.25em}.tabs.is-loading .tablist
li:not(:first-child),.tabs:not(.is-loading) .tablist
li:not(.is-selected){background-color:#f5f5f5}.tabs.is-loading .tablist
li:first-child::after,.tabs:not(.is-loading) .tablist
li.is-selected::after{background-color:inherit;content:"";display:block;height:3px
[...]
\ No newline at end of file
diff --git a/antora-ui-camel/public/_/data/rev-manifest.json
b/antora-ui-camel/public/_/data/rev-manifest.json
index a39150fe..99976b79 100644
--- a/antora-ui-camel/public/_/data/rev-manifest.json
+++ b/antora-ui-camel/public/_/data/rev-manifest.json
@@ -1,5 +1,5 @@
{
- "css/site.css": "css/site-30351b85a4.css",
+ "css/site.css": "css/site-037c96abfd.css",
"css/vendor/docsearch.css": "css/vendor/docsearch-5db8a73adb.css",
"img/algolia.svg": "img/algolia-f4ab98e0de.svg",
"img/apache-kafka.svg": "img/apache-kafka-88809b7472.svg",
diff --git a/antora-ui-camel/public/_/helpers/asset.js
b/antora-ui-camel/public/_/helpers/asset.js
index 2dca7242..93ec1271 100644
--- a/antora-ui-camel/public/_/helpers/asset.js
+++ b/antora-ui-camel/public/_/helpers/asset.js
@@ -1,7 +1,7 @@
'use strict'
const manifest = {
- "css/site.css": "css/site-30351b85a4.css",
+ "css/site.css": "css/site-037c96abfd.css",
"css/vendor/docsearch.css": "css/vendor/docsearch-5db8a73adb.css",
"img/algolia.svg": "img/algolia-f4ab98e0de.svg",
"img/apache-kafka.svg": "img/apache-kafka-88809b7472.svg",
diff --git a/antora-ui-camel/public/_/partials/head-styles.hbs
b/antora-ui-camel/public/_/partials/head-styles.hbs
index 59ae8315..e0066d45 100644
--- a/antora-ui-camel/public/_/partials/head-styles.hbs
+++ b/antora-ui-camel/public/_/partials/head-styles.hbs
@@ -1,5 +1,5 @@
<link rel="stylesheet"
href="{{uiRootPath}}/css/vendor/docsearch-5db8a73adb.css">
- <link rel="stylesheet" href="{{uiRootPath}}/css/site-30351b85a4.css">
+ <link rel="stylesheet" href="{{uiRootPath}}/css/site-037c96abfd.css">
{{!-- NOTE the asciinema partials are injected into the UI catalog by
@springio/antora-extensions at Antora build time, so they only exist
during a site build.
Guarding on the page attribute the extension sets keeps the assets off
pages with no cast,
diff --git a/antora-ui-camel/public/_/rev-manifest
b/antora-ui-camel/public/_/rev-manifest
index a39150fe..99976b79 100644
--- a/antora-ui-camel/public/_/rev-manifest
+++ b/antora-ui-camel/public/_/rev-manifest
@@ -1,5 +1,5 @@
{
- "css/site.css": "css/site-30351b85a4.css",
+ "css/site.css": "css/site-037c96abfd.css",
"css/vendor/docsearch.css": "css/vendor/docsearch-5db8a73adb.css",
"img/algolia.svg": "img/algolia-f4ab98e0de.svg",
"img/apache-kafka.svg": "img/apache-kafka-88809b7472.svg",
diff --git a/antora-ui-camel/src/css/release.css
b/antora-ui-camel/src/css/release.css
index 1e390b64..efb3fddf 100644
--- a/antora-ui-camel/src/css/release.css
+++ b/antora-ui-camel/src/css/release.css
@@ -359,6 +359,16 @@ a.advisory-facts-cta {
width: 25rem;
}
+.release-security-fixes li {
+ margin-top: calc(6 / var(--rem-base) * 1rem);
+ line-height: 1.6;
+}
+
+.release-severity {
+ font-size: calc(11.5 / var(--rem-base) * 1rem);
+ padding: calc(1 / var(--rem-base) * 1rem) calc(8 / var(--rem-base) * 1rem);
+}
+
/* responsive */
@media screen and (width <= 1024px) {
diff --git a/antora-ui-camel/src/css/security.css
b/antora-ui-camel/src/css/security.css
index 8667a8dd..1b50c99f 100644
--- a/antora-ui-camel/src/css/security.css
+++ b/antora-ui-camel/src/css/security.css
@@ -141,16 +141,6 @@
padding-right: 0;
}
-.security-advisories tbody th {
- text-align: left;
- padding: calc(26 / var(--rem-base) * 1rem) 0 calc(8 / var(--rem-base) *
1rem);
- font-family: var(--display-font-family);
- font-weight: 800;
- font-size: calc(22 / var(--rem-base) * 1rem);
- letter-spacing: -0.02em;
- color: var(--color-ink);
-}
-
.security-advisories .security-row {
border-top: 1px solid var(--color-line-soft);
}
@@ -191,14 +181,195 @@
overflow-x: auto;
}
-.security td:only-child {
- text-align: center;
-}
-
.security td:first-child {
white-space: nowrap;
}
+/* advisories context, filters and per-year sections */
+
+.security-context {
+ max-width: calc(820 / var(--rem-base) * 1rem);
+ font-size: calc(15 / var(--rem-base) * 1rem);
+ line-height: 1.6;
+ color: var(--color-ink-soft);
+}
+
+.security-context p {
+ margin: calc(10 / var(--rem-base) * 1rem) 0 0;
+}
+
+.security-context a {
+ color: var(--link-font-color);
+}
+
+.security-context a:hover {
+ color: var(--link_hover-font-color);
+}
+
+.security-filters {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: flex-end;
+ gap: calc(12 / var(--rem-base) * 1rem) calc(16 / var(--rem-base) * 1rem);
+ margin-top: calc(24 / var(--rem-base) * 1rem);
+ padding: calc(18 / var(--rem-base) * 1rem) calc(20 / var(--rem-base) * 1rem);
+ background: var(--panel-background);
+ border: 1px solid var(--panel-border-color);
+ border-radius: 12px; /* radius exemption: raw px */
+}
+
+.security-filters[hidden] {
+ display: none;
+}
+
+.security-filter {
+ display: flex;
+ flex-direction: column;
+ gap: calc(4 / var(--rem-base) * 1rem);
+ flex: 1 1 calc(150 / var(--rem-base) * 1rem);
+ min-width: 0;
+}
+
+.security-filter--wide {
+ flex-basis: calc(220 / var(--rem-base) * 1rem);
+}
+
+.security-filter-label {
+ font-family: var(--monospace-font-family);
+ font-size: calc(11.5 / var(--rem-base) * 1rem);
+ font-weight: 600;
+ color: var(--color-ink-muted);
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+}
+
+.security-filter input,
+.security-filter select,
+.security-filter-reset {
+ font: inherit;
+ font-size: calc(14 / var(--rem-base) * 1rem);
+ color: var(--color-ink);
+ background: var(--color-white);
+ border: 1px solid var(--color-line-hover);
+ border-radius: 8px; /* radius exemption: raw px */
+ box-sizing: border-box;
+ height: calc(38 / var(--rem-base) * 1rem);
+ padding: 0 calc(10 / var(--rem-base) * 1rem);
+}
+
+.security-filter input[aria-invalid="true"] {
+ border-color: var(--color-orange-deep);
+}
+
+.security-filter input:focus-visible,
+.security-filter select:focus-visible,
+.security-filter-reset:focus-visible {
+ outline: 2px solid var(--color-orange-deep);
+ outline-offset: 1px;
+}
+
+.security-filter-reset {
+ background: transparent;
+ color: var(--color-ink-2);
+}
+
+.security-filter-reset:hover {
+ border-color: var(--color-ink-muted);
+}
+
+.security-filter-hint {
+ flex-basis: 100%;
+ margin: 0;
+ font-size: calc(13 / var(--rem-base) * 1rem);
+ color: var(--color-ink-muted);
+}
+
+.security-filter-status {
+ margin: calc(14 / var(--rem-base) * 1rem) 0 0;
+ font-size: calc(15 / var(--rem-base) * 1rem);
+ line-height: 1.6;
+ color: var(--color-ink-2);
+}
+
+.security-filter-status:empty {
+ display: none;
+}
+
+.security-year {
+ border-bottom: 1px solid var(--color-line);
+}
+
+.security-year[hidden] {
+ display: none;
+}
+
+.security-year > summary {
+ display: flex;
+ align-items: baseline;
+ gap: calc(14 / var(--rem-base) * 1rem);
+ padding: calc(22 / var(--rem-base) * 1rem) 0 calc(10 / var(--rem-base) *
1rem);
+ cursor: pointer;
+ list-style: none;
+}
+
+.security-year > summary::-webkit-details-marker {
+ display: none;
+}
+
+.security-year > summary::before {
+ content: "\25B8";
+ color: var(--color-ink-muted);
+ transition: transform 0.15s;
+}
+
+.security-year[open] > summary::before {
+ transform: rotate(90deg);
+}
+
+.security-year > summary:focus-visible {
+ outline: 2px solid var(--color-orange-deep);
+ outline-offset: 2px;
+}
+
+.security-year-title {
+ margin: 0;
+ font-family: var(--display-font-family);
+ font-weight: 800;
+ font-size: calc(22 / var(--rem-base) * 1rem);
+ letter-spacing: -0.02em;
+ color: var(--color-ink);
+}
+
+.security-year-count {
+ font-family: var(--monospace-font-family);
+ font-size: calc(12.5 / var(--rem-base) * 1rem);
+ color: var(--color-ink-muted);
+}
+
+.security-year .security-advisories {
+ margin-bottom: calc(18 / var(--rem-base) * 1rem);
+}
+
+.security-year-label {
+ font-family: var(--body-font-family);
+ font-weight: 400;
+ font-size: calc(15 / var(--rem-base) * 1rem);
+ letter-spacing: 0;
+ color: var(--color-ink-muted);
+}
+
+.security-published,
+.security-project {
+ display: block;
+ margin-top: calc(2 / var(--rem-base) * 1rem);
+ font-size: calc(11.5 / var(--rem-base) * 1rem);
+ color: var(--color-ink-muted);
+}
+
+.security-row[hidden] {
+ display: none;
+}
+
/* responsive */
@media screen and (width <= 1024px) {
diff --git a/assets/js/security-advisories.js b/assets/js/security-advisories.js
new file mode 100644
index 00000000..75849505
--- /dev/null
+++ b/assets/js/security-advisories.js
@@ -0,0 +1,151 @@
+// Filters the advisories on /security/ by project, version, component,
+// severity and free text. Each row carries its structured data (see
+// data/security-advisories.yaml, generated by
scripts/security-advisory-data.js)
+// in data-* attributes; an advisory whose versions could not be parsed stays
+// visible under the version filter; the filter values are
+// mirrored in the query string so a filtered view can be shared as a link.
+;(function () {
+ 'use strict'
+
+ var form = document.getElementById('security-filters')
+ if (!form) return
+ var fields = {}
+ var status = document.getElementById('security-filter-status')
+ var years =
Array.prototype.slice.call(document.querySelectorAll('.security-year'))
+ var rows =
Array.prototype.slice.call(document.querySelectorAll('.security-row'))
+ var supported = JSON.parse(form.getAttribute('data-supported') || '[]')
+ var initiallyOpen = years.map(function (d) { return d.open })
+ var VERSION = /^\d+\.\d+\.\d+(-[A-Za-z0-9.]+)?$/
+ var FIELDS = ['project', 'version', 'component', 'severity', 'q']
+ FIELDS.forEach(function (name) { fields[name] = form.querySelector('[name="'
+ name + '"]') })
+
+ rows.forEach(function (row) {
+ row._affected = JSON.parse(row.getAttribute('data-affected') || '[]')
+ row._components = (row.getAttribute('data-components') || '').split('
').filter(Boolean)
+ row._text = row.textContent.toLowerCase().replace(/\s+/g, ' ')
+ })
+
+ function parse (version) {
+ var parts = version.split('-')
+ return { nums: parts[0].split('.').map(Number), qualifier:
parts.slice(1).join('-') }
+ }
+
+ // Numeric order; 4.0.0-M1 sorts before 4.0.0 (same rules as
+ // scripts/security-advisory-data.js).
+ function compare (a, b) {
+ var va = parse(a)
+ var vb = parse(b)
+ for (var i = 0; i < Math.max(va.nums.length, vb.nums.length); i++) {
+ var d = (va.nums[i] || 0) - (vb.nums[i] || 0)
+ if (d !== 0) return d < 0 ? -1 : 1
+ }
+ if (va.qualifier === vb.qualifier) return 0
+ if (!va.qualifier) return 1
+ if (!vb.qualifier) return -1
+ return va.qualifier < vb.qualifier ? -1 : 1
+ }
+
+ function inRange (version, range) {
+ if (range.from && compare(version, range.from) < 0) return false
+ if (range.before) return compare(version, range.before) < 0
+ if (range.to) return compare(version, range.to) <= 0
+ return true
+ }
+
+ function values () {
+ var v = {}
+ FIELDS.forEach(function (name) { v[name] = fields[name].value.trim() })
+ v.version = v.version.replace(/^v/i, '')
+ return v
+ }
+
+ function projectName (id) {
+ var option = fields.project.querySelector('option[value="' + id + '"]')
+ return option ? option.textContent : id
+ }
+
+ function lineOf (version) {
+ return version.replace(/^(\d+\.\d+)\..*$/, '$1') + '.x'
+ }
+
+ function supportNote (version) {
+ if (!supported.length) return ''
+ var line = lineOf(version)
+ var current = supported.filter(function (r) { return r.line === line })[0]
+ if (current) {
+ return compare(version, current.version) < 0
+ ? ' The newest ' + line + ' release is ' + current.version + '.'
+ : ''
+ }
+ var latest = supported[0]
+ if (compare(version, latest.version) > 0) return ''
+ return ' The ' + line + ' line no longer receives security fixes, and
advisories published after it reached' +
+ ' end of life may not list it; upgrade to a supported release (' +
+ supported.map(function (r) { return r.version }).join(', ') + ').'
+ }
+
+ function apply () {
+ var v = values()
+ var versionValid = !v.version || VERSION.test(v.version)
+ fields.version.setAttribute('aria-invalid', versionValid ? 'false' :
'true')
+ var project = v.project || (v.version ? 'camel' : '')
+ var component = v.component.toLowerCase()
+ var q = v.q.toLowerCase()
+ var active = FIELDS.some(function (name) { return v[name] })
+ var shown = 0
+
+ rows.forEach(function (row) {
+ var ok = (!project || row.getAttribute('data-project') === project) &&
+ (!v.severity || row.getAttribute('data-severity') === v.severity) &&
+ (!component || row._components.some(function (c) { return
c.indexOf(component) !== -1 })) &&
+ (!q || row._text.indexOf(q) !== -1) &&
+ (!v.version || !versionValid || row._affected.length === 0 ||
row._affected.some(function (r) { return inRange(v.version, r) }))
+ row.hidden = !ok
+ if (ok) shown++
+ })
+
+ years.forEach(function (details, i) {
+ var visible =
details.querySelectorAll('.security-row:not([hidden])').length
+ var count = details.querySelector('.security-year-count')
+ var total = Number(count.getAttribute('data-total'))
+ if (active) {
+ details.hidden = visible === 0
+ details.open = visible > 0
+ count.textContent = visible + ' of ' + total
+ } else {
+ details.hidden = false
+ details.open = initiallyOpen[i]
+ count.textContent = total ? total + (total === 1 ? ' advisory' : '
advisories') : 'No issues reported'
+ }
+ })
+
+ if (!active) status.textContent = ''
+ else if (!versionValid) status.textContent = 'Enter a full version such as
4.18.4.'
+ else if (v.version) {
+ status.textContent = (shown === 0
+ ? 'No published advisory lists ' + projectName(project) + ' ' +
v.version + ' as affected'
+ : shown + (shown === 1 ? ' advisory lists ' : ' advisories list ') +
projectName(project) + ' ' + v.version + ' as affected') +
+ (shown && (v.component || v.severity || v.q) ? ' (with the other
filters applied).' : '.') +
+ (project === 'camel' ? supportNote(v.version) : '')
+ } else status.textContent = shown + (shown === 1 ? ' advisory matches.' :
' advisories match.')
+
+ var params = new URLSearchParams()
+ FIELDS.forEach(function (name) { if (v[name]) params.set(name, v[name]) })
+ var query = params.toString()
+ history.replaceState(null, '', location.pathname + (query ? '?' + query :
'') + location.hash)
+ }
+
+ var params = new URLSearchParams(location.search)
+ FIELDS.forEach(function (name) {
+ if (params.has(name)) fields[name].value = params.get(name)
+ })
+
+ form.addEventListener('input', apply)
+ form.addEventListener('change', apply)
+ form.querySelector('.security-filter-reset').addEventListener('click',
function () {
+ FIELDS.forEach(function (name) { fields[name].value = '' })
+ apply()
+ })
+ form.hidden = false
+ if (FIELDS.some(function (name) { return params.has(name) })) apply()
+})()
diff --git a/content/security/_index.md b/content/security/_index.md
index ba5d88fd..1dee12ae 100644
--- a/content/security/_index.md
+++ b/content/security/_index.md
@@ -21,6 +21,8 @@ policy_enforcement:
Camel includes built-in Security Policy Enforcement that validates
security-sensitive configuration during startup and can prevent insecure
configurations from reaching production.
See [Security Policy Enforcement](/manual/security-policy.html) for
configuration details.
+advisories_intro: |
+ Each advisory below states the affected and fixed versions as published, and
links to its PGP-signed text. Use the filters to find the advisories that list
your project and version as affected. A release line that had already reached
end of life when an advisory was published may not appear in that advisory's
ranges, so if you run an unsupported release, upgrade rather than rely on the
filter.
reporting:
title: "Reporting new security problems with Apache Camel"
body: |
diff --git a/data/security-advisory-overrides.yaml
b/data/security-advisory-overrides.yaml
new file mode 100644
index 00000000..b8718292
--- /dev/null
+++ b/data/security-advisory-overrides.yaml
@@ -0,0 +1,91 @@
+# Hand corrections for the security advisory data, keyed by CVE id.
+#
+# The build (yarn build:hugo / preview:hugo) runs
scripts/security-advisory-data.js,
+# which reads the affected and fixed versions, the project and the components
+# from each content/security/CVE-*.md and writes data/security-advisories.yaml
+# (generated, not committed). Publishing an advisory needs no extra step.
+#
+# Add an entry here only when the text cannot say it: components the summary
+# does not name as a "Camel-Xxx:" prefix, or a correction to the parsed
+# versions. Each field given here replaces the parsed one:
+#
+# project release category id from data/release-categories.yaml
+# (camel, camel-k, camel-quarkus, ...), or karavan
+# components artifact ids, e.g. camel-aws2-s3
+# affected_ranges {from: V, before: V} covers from <= v < before,
+# {from: V, to: V} covers from <= v <= to; a missing from
+# means every earlier version
+# fixed_versions the releases that first contain the fix
+
+CVE-2026-88789:
+ components: [camel-quarkus-support-xalan, camel-quarkus-tika,
camel-quarkus-xmlsecurity, camel-quarkus-xslt, camel-quarkus-xslt-saxon]
+CVE-2026-78164:
+ components: [camel-http, camel-netty-http, camel-undertow, camel-vertx-http]
+CVE-2026-47323:
+ # The text ends in the empty range "from 4.19.0 before 4.19.0" (4.19.0 has
the fix).
+ affected_ranges:
+ - {from: "3.18.0", before: "4.14.6"}
+ - {from: "4.15.0", before: "4.18.2"}
+CVE-2026-43866:
+ components: [camel-activemq, camel-activemq6, camel-amqp, camel-jms,
camel-sjms, camel-sjms2]
+CVE-2026-42527:
+ components: [camel-amqp, camel-cassandraql, camel-consul, camel-infinispan,
camel-jms, camel-leveldb, camel-mina, camel-netty, camel-netty-http,
camel-sjms, camel-sql, camel-vertx-http]
+CVE-2026-40860:
+ components: [camel-amqp, camel-jms, camel-sjms, camel-sjms2]
+CVE-2026-40453:
+ components: [camel-coap, camel-google-pubsub, camel-jms, camel-sjms]
+CVE-2026-33453:
+ components: [camel-coap]
+CVE-2026-27172:
+ components: [camel-consul]
+CVE-2025-66169:
+ components: [camel-neo4j]
+CVE-2025-29891:
+ components: [camel-bean, camel-exec, camel-jetty, camel-netty-http,
camel-platform-http, camel-servlet, camel-undertow]
+CVE-2025-27636:
+ components: [camel-bean, camel-jetty, camel-netty-http, camel-platform-http,
camel-servlet, camel-undertow]
+CVE-2024-22371:
+ components: [camel-core]
+CVE-2023-34442:
+ components: [camel-jira]
+CVE-2022-45046:
+ components: [camel-ldap]
+CVE-2020-11973:
+ components: [camel-netty]
+CVE-2020-11972:
+ components: [camel-rabbitmq]
+CVE-2020-11971:
+ components: [camel-management]
+CVE-2019-0194:
+ components: [camel-core]
+CVE-2019-0188:
+ components: [camel-xmljson]
+CVE-2018-8041:
+ components: [camel-mail]
+ fixed_versions: ["2.20.4", "2.21.2", "2.22.1"] # the mitigation text says
2.21.2; the fixed field says 2.21.1
+CVE-2018-8027:
+ components: [camel-core]
+CVE-2017-12634:
+ components: [camel-castor]
+CVE-2017-12633:
+ components: [camel-hessian]
+CVE-2017-5643:
+ components: [camel-core]
+CVE-2017-3159:
+ components: [camel-snakeyaml]
+CVE-2016-8749:
+ components: [camel-jackson, camel-jacksonxml]
+CVE-2015-5348:
+ components: [camel-jetty, camel-servlet]
+CVE-2015-5344:
+ components: [camel-xstream]
+CVE-2015-0264:
+ components: [camel-core]
+CVE-2015-0263:
+ components: [camel-core]
+CVE-2014-0003:
+ components: [camel-core]
+CVE-2014-0002:
+ components: [camel-core]
+CVE-2013-4330:
+ components: [camel-core, camel-ftp]
diff --git a/layouts/partials/security/advisory-data.html
b/layouts/partials/security/advisory-data.html
new file mode 100644
index 00000000..446bbb2a
--- /dev/null
+++ b/layouts/partials/security/advisory-data.html
@@ -0,0 +1,23 @@
+{{/*
+ Returns the structured data of a security advisory page: project,
+ components, affected_ranges and fixed_versions. Front matter fields win, so
+ an advisory can carry them before it is signed; otherwise they come from
+ data/security-advisories.yaml, which the build generates from the advisory
+ text plus data/security-advisory-overrides.yaml
+ (see scripts/security-advisory-data.js).
+
+ Context: an advisory page (type security-advisory)
+*/}}
+{{- $data := dict -}}
+{{- with index site.Data "security-advisories" -}}
+ {{- with index . $.Params.cve -}}
+ {{- $data = . -}}
+ {{- end -}}
+{{- end -}}
+{{- $p := .Params -}}
+{{- return dict
+ "project" ($p.project | default $data.project | default "camel")
+ "components" ($p.components | default $data.components | default slice)
+ "affected_ranges" ($p.affected_ranges | default $data.affected_ranges |
default slice)
+ "fixed_versions" ($p.fixed_versions | default $data.fixed_versions | default
slice)
+-}}
diff --git a/layouts/partials/security/fixed-in-release.html
b/layouts/partials/security/fixed-in-release.html
new file mode 100644
index 00000000..20a19ab0
--- /dev/null
+++ b/layouts/partials/security/fixed-in-release.html
@@ -0,0 +1,16 @@
+{{/*
+ Lists the security advisories fixed in a release: those whose project is the
+ release's category and whose fixed_versions contain its version.
+
+ Context: a release note page (type release-note)
+*/ -}}
+{{- $index := partialCached "security/fixes-by-release.html"
"security-fixes-by-release" -}}
+{{- with index $index (printf "%s %s" .Params.category .Params.version) }}
+<h2 id="security_fixes"><a class="anchor" href="#security_fixes"></a>Security
fixes in this release</h2>
+<p>This release fixes the following {{ len . }} published {{ cond (eq (len .)
1) "vulnerability" "vulnerabilities" }}. See the <a href="{{ "security/" |
relURL }}">security advisories</a> for all advisories.</p>
+<ul class="release-security-fixes">
+ {{ range . }}
+ <li><a href="{{ .RelPermalink }}">{{ .Params.cve }}</a> <span
class="severity-chip release-severity severity-chip--{{ .Params.severity |
lower }}">{{ .Params.severity | lower | title }}</span> {{ .Params.summary
}}</li>
+ {{ end }}
+</ul>
+{{- end -}}
diff --git a/layouts/partials/security/fixes-by-release.html
b/layouts/partials/security/fixes-by-release.html
new file mode 100644
index 00000000..37a74dbc
--- /dev/null
+++ b/layouts/partials/security/fixes-by-release.html
@@ -0,0 +1,17 @@
+{{/*
+ Returns a dict keyed "<project> <version>" listing, newest first, the
+ advisory pages whose fixed_versions contain that version. Call it with
+ partialCached so it is computed once per build.
+*/}}
+{{- $index := newScratch -}}
+{{- with site.GetPage "/security" -}}
+ {{- range .Pages.ByDate.Reverse -}}
+ {{- $page := . -}}
+ {{- $d := partial "security/advisory-data.html" . -}}
+ {{- range $d.fixed_versions -}}
+ {{- $key := printf "%s %s" $d.project . -}}
+ {{- $index.Add $key (slice $page) -}}
+ {{- end -}}
+ {{- end -}}
+{{- end -}}
+{{- return $index.Values -}}
diff --git a/layouts/partials/security/supported-releases.html
b/layouts/partials/security/supported-releases.html
new file mode 100644
index 00000000..439ce844
--- /dev/null
+++ b/layouts/partials/security/supported-releases.html
@@ -0,0 +1,24 @@
+{{/*
+ Returns the Apache Camel releases that currently receive security fixes,
+ newest first: the latest release, then the newest patch of each LTS line
+ whose end-of-life date (release note front matter `eol`) has not passed.
+ Each entry is a dict of version, line (e.g. "4.22.x"), lts and eol.
+*/}}
+{{- $releases := where (where site.Pages "Section" "releases")
".Params.category" "camel" -}}
+{{- $sorted := partial "releases/version_sort.html" $releases -}}
+{{- $result := slice -}}
+{{- $lines := slice -}}
+{{- with index $sorted 0 -}}
+ {{- $line := printf "%s.x" (replaceRE `\.\d+$` "" .Params.version) -}}
+ {{- $lts := and (eq .Params.kind "lts") .Params.eol (gt (time
.Params.eol).Unix now.Unix) -}}
+ {{- $result = $result | append (dict "version" .Params.version "line" $line
"lts" $lts "eol" (cond $lts .Params.eol "")) -}}
+ {{- $lines = $lines | append $line -}}
+{{- end -}}
+{{- range where $sorted ".Params.kind" "lts" -}}
+ {{- $line := printf "%s.x" (replaceRE `\.\d+$` "" .Params.version) -}}
+ {{- if and (not (in $lines $line)) .Params.eol (gt (time .Params.eol).Unix
now.Unix) -}}
+ {{- $result = $result | append (dict "version" .Params.version "line"
$line "lts" true "eol" .Params.eol) -}}
+ {{- $lines = $lines | append $line -}}
+ {{- end -}}
+{{- end -}}
+{{- return $result -}}
diff --git a/layouts/release-note/single.html b/layouts/release-note/single.html
index 36819cbc..753d5f5b 100644
--- a/layouts/release-note/single.html
+++ b/layouts/release-note/single.html
@@ -5,6 +5,8 @@
<h2 id="whats_new"><a class="anchor" href="#whats_new"></a>New and
Noteworthy</h2>
{{ .Content }}
+ {{- partial "security/fixed-in-release.html" . }}
+
{{ with .Params.jdk }}
<h2 id="jdk"><a class="anchor" href="#jdk"></a>Supported Java
version</h2>
This version supports Java {{ delimit . ", " " and " }}.
diff --git a/layouts/security/list.html b/layouts/security/list.html
index a265aaa8..d3cb0d41 100644
--- a/layouts/security/list.html
+++ b/layouts/security/list.html
@@ -35,58 +35,121 @@
</div>
</div>
- <h2 class="section-label">Security advisories</h2>
- <div class="table-wrapper">
- <table class="security-advisories" aria-label="Security
advisories by year">
- <thead>
- <tr>
- <th>Reference</th>
- <th>Affected</th>
- <th>Fixed</th>
- <th>Severity</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- {{ $pages := .Pages.GroupByDate "2006" "desc" }}
- {{ $earliest_year := (index (.Pages.GroupByDate "2006" "asc")
0).Key }}
- {{ range $year := seq (now.Format "2006") $earliest_year }}
- {{ $has_any := false }}
- {{ range $pages }}
- {{ if eq $year (int .Key) }}
- {{ $has_any = true}}
- {{ break }}
- {{ end }}
- {{ end }}
- {{ if $has_any }}
- {{ range $pages }}
- {{ if eq $year (int .Key) }}
+ {{ $projects := dict "camel" "Apache Camel" "camel-k" "Camel K"
"camel-quarkus" "Camel Quarkus" "karavan" "Karavan" }}
+ {{ $supported := partial "security/supported-releases.html" . }}
+
+ <h2 class="section-label" id="advisories">Security advisories</h2>
+ <div class="security-context">
+ {{ with .Params.advisories_intro }}<p>{{ . | markdownify
}}</p>{{ end }}
+ <p>
+ Security fixes ship in the supported Apache Camel releases:
+ {{ range $i, $r := $supported -}}
+ {{ if $i }}, {{ end }}<strong>{{ $r.version }}</strong>{{ if
$r.lts }} ({{ $r.line }} LTS, supported until {{ dateFormat "January 2006"
(time $r.eol) }}){{ else }} (latest){{ end }}
+ {{- end }}.
+ See <a href="{{ "download/" | relURL }}">Download</a> for
every supported release line, including the Camel subprojects.
+ </p>
+ {{ $posts := where (where site.RegularPages "Section" "blog")
"File.Dir" "like" `camel-security-advisories-` }}
+ {{ with $posts }}
+ <p>
+ Batch announcements:
+ {{ range $i, $p := .ByDate.Reverse -}}
+ {{ if $i }}, {{ end }}<a href="{{ $p.RelPermalink }}">{{
$p.Title }}</a>
+ {{- end }}.
+ More in the <a href="{{ "categories/Security/" | relURL
}}">Security</a> blog category.
+ </p>
+ {{ end }}
+ </div>
+
+ {{/* the filters need JavaScript
(assets/js/security-advisories.js), so they stay hidden without it */}}
+ <div class="security-filters" id="security-filters" role="search"
aria-label="Filter security advisories" hidden
+ data-supported="{{ $supported | jsonify }}">
+ <label class="security-filter">
+ <span class="security-filter-label">Project</span>
+ <select name="project">
+ <option value="">All projects</option>
+ {{ range $id, $name := $projects }}<option value="{{ $id
}}">{{ $name }}</option>{{ end }}
+ </select>
+ </label>
+ <label class="security-filter">
+ <span class="security-filter-label">Your version</span>
+ <input name="version" type="text" inputmode="decimal"
autocomplete="off" spellcheck="false" placeholder="e.g. 4.18.4"
aria-describedby="security-version-hint">
+ </label>
+ <label class="security-filter">
+ <span class="security-filter-label">Component</span>
+ <input name="component" type="text" list="security-components"
autocomplete="off" spellcheck="false" placeholder="e.g. camel-kafka">
+ </label>
+ <label class="security-filter">
+ <span class="security-filter-label">Severity</span>
+ <select name="severity">
+ <option value="">Any</option>
+ {{ range slice "critical" "high" "medium" "low" }}<option
value="{{ . }}">{{ . | title }}</option>{{ end }}
+ </select>
+ </label>
+ <label class="security-filter security-filter--wide">
+ <span class="security-filter-label">Search</span>
+ <input name="q" type="search" autocomplete="off"
spellcheck="false" placeholder="CVE id or keyword">
+ </label>
+ <button class="security-filter-reset"
type="button">Clear</button>
+ <p class="security-filter-hint" id="security-version-hint">A
version is checked against the published affected ranges of the selected
project (Apache Camel when none is selected).</p>
+ </div>
+ <p class="security-filter-status" id="security-filter-status"
role="status" aria-live="polite"></p>
+
+ {{ $components := slice }}
+ {{ $groups := .Pages.GroupByDate "2006" "desc" }}
+ {{ $newest_year := int (index $groups 0).Key }}
+ {{ $earliest_year := int (index $groups (sub (len $groups) 1)).Key
}}
+ {{ range $year := seq (now.Format "2006") $earliest_year }}
+ {{ $pages := slice }}
+ {{ range $groups }}{{ if eq (int .Key) $year }}{{ $pages =
.Pages }}{{ end }}{{ end }}
+ <details class="security-year" data-year="{{ $year }}"{{ if ge
$year $newest_year }} open{{ end }}>
+ <summary>
+ <h3 class="security-year-title"><span
class="security-year-label">Published in</span> {{ $year }}</h3>
+ <span class="security-year-count" data-total="{{ len $pages
}}">{{ with len $pages }}{{ . }} {{ cond (eq . 1) "advisory" "advisories" }}{{
else }}No issues reported{{ end }}</span>
+ </summary>
+ {{ with $pages }}
+ <div class="table-wrapper">
+ <table class="security-advisories" aria-label="Security
advisories published in {{ $year }}">
+ <thead>
<tr>
- <th colspan="5" scope="row">{{ .Key }}</th>
+ <th scope="col">Reference</th>
+ <th scope="col">Affected</th>
+ <th scope="col">Fixed</th>
+ <th scope="col">Severity</th>
+ <th scope="col">Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ range . }}
+ {{ $d := partial "security/advisory-data.html" . }}
+ {{ $components = $components | append $d.components }}
+ <tr class="security-row"
+ data-project="{{ $d.project }}"
+ data-components="{{ delimit $d.components " " }}"
+ data-severity="{{ .Params.severity | lower }}"
+ data-affected="{{ $d.affected_ranges | jsonify }}">
+ <td>
+ <a href="{{ .RelPermalink }}">{{ .Params.cve }}</a>
+ <span class="security-published">Published <time
datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2 Jan 2006"
}}</time></span>
+ {{ if ne $d.project "camel" }}<span
class="security-project">{{ index $projects $d.project | default $d.project
}}</span>{{ end }}
+ </td>
+ <td>{{ .Params.affected }}</td>
+ <td>{{ .Params.fixed }}</td>
+ <td><span class="severity-chip security-severity
severity-chip--{{ .Params.severity | lower }}">{{ .Params.severity | lower |
title }}</span></td>
+ <td>{{ .Params.summary }}</td>
</tr>
- {{ range .Pages }}
- <tr class="security-row">
- <td><a href="{{ .RelPermalink }}">{{ .Params.cve
}}</a></td>
- <td>{{ .Params.affected }}</td>
- <td>{{ .Params.fixed }}</td>
- <td><span class="severity-chip security-severity
severity-chip--{{ .Params.severity | lower }}">{{ .Params.severity | lower |
title }}</span></td>
- <td>{{ .Params.summary }}</td>
- </tr>
- {{ end }}
{{ end }}
- {{ end }}
- {{ else }}
- <tr>
- <th colspan="5" scope="row">{{ $year }}</th>
- </tr>
- <tr>
- <td colspan="5"><em>No issues reported</em></td>
- </tr>
+ </tbody>
+ </table>
+ </div>
{{ end }}
- {{ end }}
- </tbody>
- </table>
- </div>
+ </details>
+ {{ end }}
+ <datalist id="security-components">
+ {{ range $components | uniq | sort }}<option value="{{ .
}}"></option>{{ end }}
+ </datalist>
+ {{ with resources.Get "js/security-advisories.js" | minify |
fingerprint }}
+ <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity
}}" defer></script>
+ {{ end }}
</article>
</main>
diff --git a/package.json b/package.json
index 0191b25b..7cc8627d 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
"build:antora": "run-s -l build:antora-prep build:antora-perf",
"build:antora-prep": "yarn exec
antora-playbook-snippets/assemble-playbook.sh antora-playbook-production.yml
playbook-export-site-manifest.yml",
"build:antora-perf": "antora --clean --fetch
antora-playbook-production.yml --stacktrace",
- "build:hugo": "hugo --cacheDir ${HUGO_CACHE_DIR:-$(pwd)/.hugo_data}
${HUGO_OPTIONS:-}",
+ "build:hugo": "node scripts/security-advisory-data.js && hugo --cacheDir
${HUGO_CACHE_DIR:-$(pwd)/.hugo_data} ${HUGO_OPTIONS:-}",
"build:markdown": "gulp generate-markdown",
"build:minify": "gulp minify",
"build:sitemap": "gulp sitemap",
@@ -27,7 +27,7 @@
"update:cache": "yarn workspaces foreach --all install --check-cache",
"update:dedupe": "yarn workspaces foreach --all dedupe",
"preview": "run-s -l build:antora preview:hugo",
- "preview:hugo": "hugo server --bind=0.0.0.0 -D",
+ "preview:hugo": "node scripts/security-advisory-data.js && hugo server
--bind=0.0.0.0 -D",
"preview:netlify": "netlify deploy --dir public --cwd .",
"build:antora-local-full": "antora antora-playbook-local-full.yml
--stacktrace --clean --fetch",
"build:antora-local-partial": "antora antora-playbook-local-partial.yml
--stacktrace",
diff --git a/scripts/security-advisory-data.js
b/scripts/security-advisory-data.js
new file mode 100644
index 00000000..37253895
--- /dev/null
+++ b/scripts/security-advisory-data.js
@@ -0,0 +1,232 @@
+#!/usr/bin/env node
+'use strict'
+
+// Generates data/security-advisories.yaml from the advisories in
+// content/security. The build runs it before Hugo (yarn build:hugo and
+// yarn preview:hugo), so publishing an advisory needs no extra step; the
+// generated file is not committed.
+//
+// The advisory pages describe the affected and fixed versions in free text
+// ("From 4.0.0 before 4.18.5, from 4.19.0 before 4.22.1."). The /security/
+// filters and the "Security fixes in this release" section of the release
+// notes need them as data, so this script parses the text into version ranges,
+// reads the project from the text and the components from a "Camel-Xxx:"
+// summary prefix.
+//
+// The data is not kept in the advisory front matter because each CVE-*.md is
+// signed byte for byte as CVE-*.txt.asc. What the text cannot say (components
+// the summary does not name, a correction to a parsed version) goes in
+// data/security-advisory-overrides.yaml, field by field. A new advisory may
+// also carry project, components, affected_ranges and fixed_versions in its
+// front matter before it is signed; those win over everything else.
+//
+// Usage:
+// node scripts/security-advisory-data.js write the data file,
warn about text it could not parse
+// node scripts/security-advisory-data.js --strict same, but exit 1 when
there are warnings
+//
+// An advisory whose versions cannot be parsed is still listed on /security/;
+// the version filter keeps it visible rather than hide it.
+
+const fs = require('node:fs')
+const path = require('node:path')
+const yaml = require('js-yaml')
+
+const ROOT = path.join(__dirname, '..')
+const CONTENT_DIR = path.join(ROOT, 'content', 'security')
+const DATA_FILE = path.join(ROOT, 'data', 'security-advisories.yaml')
+const OVERRIDES_FILE = path.join(ROOT, 'data',
'security-advisory-overrides.yaml')
+
+const VERSION = '\\d+\\.\\d+\\.\\d+(?:-[A-Za-z0-9.]+)?'
+
+const HEADER = `# GENERATED by scripts/security-advisory-data.js during the
build; do not
+# edit or commit. Corrections go in data/security-advisory-overrides.yaml.
+`
+
+function versionPattern (source) {
+ return new RegExp(source.replaceAll('V', `(${VERSION})`), 'i')
+}
+
+const RANGE_PATTERNS = [
+ [versionPattern('^V before V$'), (m) => ({ from: m[1], before: m[2] })],
+ [versionPattern('^V (?:up to|through) V$'), (m) => ({ from: m[1], to: m[2]
})],
+ [versionPattern('^(?:versions )?prior to V$'), (m) => ({ before: m[1] })],
+ [/^(\d+)\.(\d+)\.x before (\d+\.\d+\.\d+)$/i, (m) => ({ from:
`${m[1]}.${m[2]}.0`, before: m[3] })],
+ [/^(\d+)\.(\d+)\.x$/i, (m) => ({ from: `${m[1]}.${m[2]}.0`, before:
`${m[1]}.${Number(m[2]) + 1}.0` })],
+ [versionPattern('^V$'), (m) => ({ from: m[1], to: m[1] })],
+]
+
+function parseVersion (version) {
+ const [core, qualifier] = String(version).split('-', 2)
+ return { parts: core.split('.').map(Number), qualifier }
+}
+
+// Orders versions numerically; a qualified version (4.0.0-M1) sorts before
+// the release it precedes, and qualifiers compare as text (M1 < M3 < RC1).
+function compareVersions (a, b) {
+ const va = parseVersion(a)
+ const vb = parseVersion(b)
+ for (let i = 0; i < Math.max(va.parts.length, vb.parts.length); i++) {
+ const d = (va.parts[i] || 0) - (vb.parts[i] || 0)
+ if (d !== 0) return Math.sign(d)
+ }
+ if (va.qualifier === vb.qualifier) return 0
+ if (!va.qualifier) return 1
+ if (!vb.qualifier) return -1
+ return va.qualifier < vb.qualifier ? -1 : 1
+}
+
+function inRange (version, range) {
+ if (range.from && compareVersions(version, range.from) < 0) return false
+ if (range.before) return compareVersions(version, range.before) < 0
+ if (range.to) return compareVersions(version, range.to) <= 0
+ return true
+}
+
+function isEmptyRange (range) {
+ if (!range.from) return false
+ if (range.before) return compareVersions(range.from, range.before) >= 0
+ return compareVersions(range.from, range.to) > 0
+}
+
+// Parses the free-text affected versions into ranges. Returns the ranges and
+// the parts of the text that matched no pattern or described an empty range.
+function parseAffected (text) {
+ const ranges = []
+ const unparsed = []
+ const cleaned = String(text)
+ .replace(/^.*?This issue affects Apache Camel [A-Za-z ]+:/i, '')
+ .replace(/\([^)]*\)/g, '')
+ .replace(/\.\s*$/, '')
+ for (let segment of cleaned.split(/\.\s+|,\s*|\s+and\s+/)) {
+ segment = segment.trim()
+ .replace(/^and\s+/i, '')
+ .replace(/^apache camel\s+/i, '')
+ .replace(/^from\s+/i, '')
+ .replace(/\s+/g, ' ')
+ if (!segment) continue
+ const match = RANGE_PATTERNS.map(([re, build]) => [segment.match(re),
build]).find(([m]) => m)
+ if (!match) {
+ unparsed.push(segment)
+ continue
+ }
+ const range = match[1](match[0])
+ if (isEmptyRange(range)) unparsed.push(`${segment} (empty range)`)
+ else ranges.push(range)
+ }
+ return { ranges, unparsed }
+}
+
+function parseFixed (text) {
+ return [...String(text).matchAll(new RegExp(VERSION, 'g'))].map((m) => m[0])
+}
+
+function detectProject (fm) {
+ const text = `${fm.affected} ${fm.summary} ${fm.description}`
+ if (/Apache Camel K\b|^Camel K\b/.test(text) || /^Camel
K\b/.test(fm.summary)) return 'camel-k'
+ if (/Apache Camel Quarkus|^Camel Quarkus\b/.test(text) || /^Camel
Quarkus\b/.test(fm.summary)) return 'camel-quarkus'
+ if (/Apache Camel Karavan/.test(text) || /^Karavan\b/.test(fm.summary))
return 'karavan'
+ return 'camel'
+}
+
+// Finds components named as a summary prefix: "Camel-AWS2-S3: ...",
+// "Apache Camel: Camel-SQL: ...", "Camel-CXF and Camel-Knative ...".
+function detectComponents (summary) {
+ const m = String(summary).match(/^(?:Apache
Camel:\s*)?(Camel-[A-Za-z0-9-]+(?:\s+and\s+Camel-[A-Za-z0-9-]+)*)/)
+ if (!m) return []
+ return m[1].split(/\s+and\s+/).map((name) => name.toLowerCase())
+}
+
+function readAdvisories () {
+ return fs.readdirSync(CONTENT_DIR)
+ .filter((f) => /^CVE-.*\.md$/.test(f))
+ .map((f) => {
+ const text = fs.readFileSync(path.join(CONTENT_DIR, f), 'utf8')
+ const fm = yaml.load(text.split(/^---$/m)[1])
+ return { file: f, fm }
+ })
+}
+
+function readOverrides () {
+ if (!fs.existsSync(OVERRIDES_FILE)) return {}
+ return yaml.load(fs.readFileSync(OVERRIDES_FILE, 'utf8')) || {}
+}
+
+function buildEntry (fm) {
+ const { ranges, unparsed } = parseAffected(fm.affected)
+ return {
+ entry: {
+ project: detectProject(fm),
+ components: detectComponents(fm.summary),
+ affected_ranges: ranges,
+ fixed_versions: parseFixed(fm.fixed),
+ },
+ unparsed,
+ }
+}
+
+function cveOrder (a, b) {
+ const [, ya, na] = a.split('-').map(Number)
+ const [, yb, nb] = b.split('-').map(Number)
+ return yb - ya || nb - na
+}
+
+const q = (v) => JSON.stringify(String(v))
+
+function renderRange (range) {
+ return '{' + ['from', 'before', 'to'].filter((k) => range[k]).map((k) =>
`${k}: ${q(range[k])}`).join(', ') + '}'
+}
+
+function renderData (data) {
+ const lines = [HEADER]
+ for (const cve of Object.keys(data).sort(cveOrder)) {
+ const e = data[cve]
+ lines.push(`${cve}:`)
+ lines.push(` project: ${e.project}`)
+ lines.push(` components: [${(e.components || []).join(', ')}]`)
+ if (e.affected_ranges.length === 0) lines.push(' affected_ranges: []')
+ else {
+ lines.push(' affected_ranges:')
+ for (const range of e.affected_ranges) lines.push(` -
${renderRange(range)}`)
+ }
+ lines.push(` fixed_versions: [${e.fixed_versions.map(q).join(', ')}]`)
+ }
+ return lines.join('\n') + '\n'
+}
+
+// Builds the data for every advisory: parsed from the text, then the
+// overrides applied field by field. Returns the data and the warnings.
+function generate (advisories = readAdvisories(), overrides = readOverrides())
{
+ const data = {}
+ const warnings = []
+ for (const { file, fm } of advisories) {
+ const { entry, unparsed } = buildEntry(fm)
+ const override = overrides[fm.cve] || {}
+ data[fm.cve] = { ...entry, ...override }
+ const fromFrontMatter = (field) => field in override || field in fm
+ if (!fromFrontMatter('affected_ranges')) {
+ for (const part of unparsed) warnings.push(`${file}: could not parse
affected "${part}"`)
+ if (entry.affected_ranges.length === 0) warnings.push(`${file}: no
affected versions found in "${fm.affected}"`)
+ }
+ if (!fromFrontMatter('fixed_versions') && entry.fixed_versions.length ===
0) {
+ warnings.push(`${file}: no fixed versions found in "${fm.fixed}"`)
+ }
+ }
+ const cves = new Set(advisories.map(({ fm }) => fm.cve))
+ for (const cve of Object.keys(overrides)) {
+ if (!cves.has(cve)) warnings.push(`data/security-advisory-overrides.yaml:
${cve} has no advisory page`)
+ }
+ return { data, warnings }
+}
+
+function main (args) {
+ const { data, warnings } = generate()
+ fs.writeFileSync(DATA_FILE, renderData(data))
+ for (const w of warnings) console.warn(`WARN security advisories: ${w}`)
+ console.log(`security advisories: wrote ${Object.keys(data).length} entries
to data/security-advisories.yaml` +
+ (warnings.length ? ` (${warnings.length} warnings; add a correction to
data/security-advisory-overrides.yaml)` : ''))
+ if (args.includes('--strict') && warnings.length) process.exit(1)
+}
+
+module.exports = { compareVersions, inRange, parseAffected, parseFixed,
detectProject, detectComponents, renderData, readAdvisories, readOverrides,
generate, DATA_FILE, OVERRIDES_FILE }
+
+if (require.main === module) main(process.argv.slice(2))
diff --git a/test/security-advisories-test.js b/test/security-advisories-test.js
new file mode 100644
index 00000000..41082c6d
--- /dev/null
+++ b/test/security-advisories-test.js
@@ -0,0 +1,103 @@
+'use strict'
+
+const assert = require('node:assert/strict')
+const fs = require('node:fs')
+const path = require('node:path')
+const test = require('node:test')
+const yaml = require('js-yaml')
+
+const {
+ compareVersions, inRange, parseAffected, parseFixed, detectProject,
detectComponents, readAdvisories, readOverrides, generate,
+} = require('../scripts/security-advisory-data')
+
+const advisories = readAdvisories()
+const overrides = readOverrides()
+// The data the build generates, computed in memory so the tests do not depend
+// on a previous build. Warnings (text the parser cannot read) are not test
+// failures: the build reports them, and the advisory is still listed.
+const { data } = generate(advisories, overrides)
+const categories = Object.keys(yaml.load(fs.readFileSync(path.join(__dirname,
'..', 'data', 'release-categories.yaml'), 'utf8')))
+const PROJECTS = new Set([...categories, 'karavan'])
+const VERSION = /^\d+\.\d+\.\d+(-[A-Za-z0-9.]+)?$/
+
+test('every override belongs to an advisory page and uses known fields', () =>
{
+ const cves = new Set(advisories.map(({ fm }) => fm.cve))
+ assert.deepEqual(Object.keys(overrides).filter((cve) => !cves.has(cve)), [])
+ const fields = new Set(['project', 'components', 'affected_ranges',
'fixed_versions'])
+ for (const [cve, o] of Object.entries(overrides)) {
+ for (const field of Object.keys(o)) assert.ok(fields.has(field), `${cve}:
unknown field ${field}`)
+ }
+})
+
+test('overrides win field by field over the parsed text', () => {
+ const advisory = { file: 'CVE-0000-1.md', fm: { cve: 'CVE-0000-1', affected:
'From 4.0.0 before 4.18.5.', fixed: '4.18.5', summary: 'Camel-FTP: x',
description: '' } }
+ const { data: d, warnings } = generate([advisory], { 'CVE-0000-1': {
components: ['camel-file'] } })
+ assert.deepEqual(d['CVE-0000-1'], {
+ project: 'camel', components: ['camel-file'], affected_ranges: [{ from:
'4.0.0', before: '4.18.5' }], fixed_versions: ['4.18.5'],
+ })
+ assert.deepEqual(warnings, [])
+})
+
+test('an advisory the parser cannot read is a warning, not an error', () => {
+ const advisory = { file: 'CVE-0000-2.md', fm: { cve: 'CVE-0000-2', affected:
'all versions', fixed: 'none yet', summary: '', description: '' } }
+ const { data: d, warnings } = generate([advisory], {})
+ assert.deepEqual(d['CVE-0000-2'].affected_ranges, [])
+ assert.equal(warnings.length, 3)
+})
+
+test('the data entries are well formed and consistent', () => {
+ for (const [cve, e] of Object.entries(data)) {
+ assert.ok(PROJECTS.has(e.project), `${cve}: unknown project ${e.project}`)
+ assert.ok(Array.isArray(e.components), `${cve}: components must be a list`)
+ for (const range of e.affected_ranges) {
+ for (const v of Object.values(range)) assert.match(String(v), VERSION,
`${cve}: bad version in range`)
+ assert.ok(range.before || range.to, `${cve}: range without an upper
bound`)
+ }
+ for (const v of e.fixed_versions) {
+ assert.match(String(v), VERSION, `${cve}: bad fixed version ${v}`)
+ assert.ok(!e.affected_ranges.some((r) => inRange(v, r)), `${cve}: fixed
version ${v} is inside an affected range`)
+ }
+ }
+})
+
+test('versions compare numerically, with qualifiers before the release', () =>
{
+ assert.equal(compareVersions('4.10.0', '4.9.9'), 1)
+ assert.equal(compareVersions('4.18.4', '4.18.4'), 0)
+ assert.equal(compareVersions('4.0.0-M3', '4.0.0'), -1)
+ assert.equal(compareVersions('4.0.0-M3', '4.0.0-RC1'), -1)
+})
+
+test('ranges: before is exclusive, to is inclusive, a missing from is open',
() => {
+ assert.ok(inRange('4.18.4', { from: '4.0.0', before: '4.18.5' }))
+ assert.ok(!inRange('4.18.5', { from: '4.0.0', before: '4.18.5' }))
+ assert.ok(inRange('2.21.1', { from: '2.21.0', to: '2.21.1' }))
+ assert.ok(inRange('1.6.0', { before: '2.24.0' }))
+})
+
+test('the affected-version phrasings used by the advisories parse', () => {
+ const cases = {
+ 'From 4.0.0 before 4.18.5, from 4.19.0 before 4.22.1.': [{ from: '4.0.0',
before: '4.18.5' }, { from: '4.19.0', before: '4.22.1' }],
+ 'This issue affects Apache Camel K: from 2.0.0 before 2.9.3, from 2.10.0
before 2.10.2': [{ from: '2.0.0', before: '2.9.3' }, { from: '2.10.0', before:
'2.10.2' }],
+ '2.9.0 up to 2.9.7, 2.12.0': [{ from: '2.9.0', to: '2.9.7' }, { from:
'2.12.0', to: '2.12.0' }],
+ '2.24.x, 2.25.0 and 2.25.1': [{ from: '2.24.0', before: '2.25.0' }, {
from: '2.25.0', to: '2.25.0' }, { from: '2.25.1', to: '2.25.1' }],
+ 'Apache Camel versions prior to 2.24.0': [{ before: '2.24.0' }],
+ 'Apache Camel 4.10.x before 4.10.8, Apache Camel 4.15.0 and 4.16.0.': [{
from: '4.10.0', before: '4.10.8' }, { from: '4.15.0', to: '4.15.0' }, { from:
'4.16.0', to: '4.16.0' }],
+ 'Apache Camel 4.14.0 through 4.14.7 (4.14.x line). Apache Camel 4.20.0.':
[{ from: '4.14.0', to: '4.14.7' }, { from: '4.20.0', to: '4.20.0' }],
+ '4.0.0-M1 up to 4.0.0-M3': [{ from: '4.0.0-M1', to: '4.0.0-M3' }],
+ }
+ for (const [text, ranges] of Object.entries(cases)) {
+ assert.deepEqual(parseAffected(text), { ranges, unparsed: [] }, text)
+ }
+ assert.deepEqual(parseAffected('from 4.19.0 before 4.19.0').unparsed,
['4.19.0 before 4.19.0 (empty range)'])
+})
+
+test('fixed versions, project and components are read from the text', () => {
+ assert.deepEqual(parseFixed('4.14.8, 4.18.3 and 4.21.0'), ['4.14.8',
'4.18.3', '4.21.0'])
+ assert.deepEqual(parseFixed('2.9.8, 2.12.1 and newer'), ['2.9.8', '2.12.1'])
+ assert.equal(detectProject({ affected: 'This issue affects Apache Camel K:
from 2.0.0 before 2.9.3', summary: '', description: '' }), 'camel-k')
+ assert.equal(detectProject({ affected: 'From 4.0.0 before 4.22.1.', summary:
'Karavan applies ...', description: '' }), 'karavan')
+ assert.equal(detectProject({ affected: 'From 4.0.0 before 4.22.1.', summary:
'Camel-FTP: ...', description: '' }), 'camel')
+ assert.deepEqual(detectComponents('Apache Camel: Camel-SQL: Unsafe
Deserialization'), ['camel-sql'])
+ assert.deepEqual(detectComponents('Camel-Vertx-Http and Camel-Netty-Http:
Unsafe'), ['camel-vertx-http', 'camel-netty-http'])
+ assert.deepEqual(detectComponents('LDAP Injection in camel-ldap'), [])
+})
diff --git a/tests/hugo/build.sh b/tests/hugo/build.sh
index 5e34d6c3..bdbee344 100755
--- a/tests/hugo/build.sh
+++ b/tests/hugo/build.sh
@@ -87,6 +87,9 @@ for asset_dir in css js img font data; do
fi
done
+# Same as yarn build:hugo: generate the security advisory data first.
+node scripts/security-advisory-data.js >/dev/null
+
if ! node_modules/.bin/hugo --cacheDir "${HUGO_CACHE_DIR:-$REPO/.hugo_data}"
${HUGO_OPTIONS:-} -d "$SITE" >"$LOG" 2>&1; then
echo "hugo build FAILED. Last 20 lines of $LOG:" >&2
tail -20 "$LOG" >&2