You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by js...@apache.org on 2026/10/19 05:31:26 UTC
(httpd-site) branch preview/cve-list-improvements updated: Security pages: sort CVEs by severity within a release, lead each line with the CVE id
This is an automated email from the ASF dual-hosted git repository.
lingfish pushed a commit to branch preview/cve-list-improvements
in repository https://gitbox.apache.org/repos/asf/httpd-site.git
The following commit(s) were added to refs/heads/preview/cve-list-improvements by this push:
new 2aa3e61 Security pages: sort CVEs by severity within a release, lead each line with the CVE id
2aa3e61 is described below
commit 2aa3e619a5909ec1976534d84f9cacc57167e000
Author: Jason Lingohr <js...@apache.org>
AuthorDate: Mon Oct 19 16:31:20 2026 +1100
Security pages: sort CVEs by severity within a release, lead each line with the CVE id
---
content/security/cvejsontohtml.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/content/security/cvejsontohtml.py b/content/security/cvejsontohtml.py
index 411b8af..bfd34a1 100755
--- a/content/security/cvejsontohtml.py
+++ b/content/security/cvejsontohtml.py
@@ -28,6 +28,9 @@ filterversion = options.filterversion or ""
cves = []
entries = {}
DEFAULT_CVE_DATA_VERSION = "4.0" # Default (old) CVE data version
+# Sort order for CVEs within a release: most severe first. Anything else (e.g. "n/a")
+# sorts last.
+IMPACT_ORDER = {"critical": 0, "important": 1, "moderate": 2, "low": 3}
for x in os.listdir(options.directory or "./"):
if x.endswith(".json"):
@@ -88,7 +91,7 @@ for k,v in sorted(entries.items(), key=lambda s: [int(u) if u.isdigit() else 999
fixedv = k.split(",")[0]
sectioncves = []
- for cve in sorted(v, key=lambda s: [int(u) if u.isdigit() else u for u in s["id"].split('-')]):
+ for cve in v:
e = {}
e['cveid'] = cve["id"]
data_version = cve.get("dataVersion", DEFAULT_CVE_DATA_VERSION)
@@ -168,6 +171,9 @@ for k,v in sorted(entries.items(), key=lambda s: [int(u) if u.isdigit() else 999
timed = "Update "+timed
e['timetable'].append([timed,time["time"]])
sectioncves.append(e)
+ # Within a release, sort by impact (most severe first), then by CVE id.
+ sectioncves.sort(key=lambda e: (IMPACT_ORDER.get(e['impact'].lower(), 9),
+ [int(u) if u.isdigit() else u for u in e['cveid'].split('-')]))
sections.append({"cves":sectioncves,"fixed":fixedv,"product":productname})
# Everything is sorted and pretty, this should be some python template thing
@@ -190,8 +196,7 @@ for sectioncves in sections:
print ("\n<h1 id=\""+sectioncves["fixed"]+"\">Fixed in "+sectioncves["product"]+" "+sectioncves["fixed"]
+" <span class=\"cve-count\">"+str(count)+" CVE"+("s" if count != 1 else "")+"</span></h1><dl class=\"cve-list\">\n")
for e in sectioncves["cves"]:
- html = "<dt><h3 id=\""+e['cveid']+"\">"+e['impact']+": <name name=\""+e['cveid']+"\">"+saxutils.escape(e['title'])+"</name>\n";
- html += "(<a href=\"https://www.cve.org/CVERecord?id="+e['cveid']+"\">"+e['cveid']+"</a>)"
+ html = "<dt><h3 id=\""+e['cveid']+"\"><a href=\"https://www.cve.org/CVERecord?id="+e['cveid']+"\">"+e['cveid']+"</a> ("+e['impact']+"): <name name=\""+e['cveid']+"\">"+saxutils.escape(e['title'])+"</name>\n";
html += "<a class=\"headerlink\" href=\"#"+e['cveid']+"\" title=\"Permanent link\">¶</a></h3></dt>\n";
desc = saxutils.escape(e['desc'])
desc = re.sub(r'\n','</p><p>', desc)