]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a Sphinx role for linking CVEs to the ISC Knowledgebase
authorMichal Nowak <mnowak@isc.org>
Thu, 31 Aug 2023 16:55:36 +0000 (18:55 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 21 Sep 2023 12:18:02 +0000 (14:18 +0200)
The new :cve: Sphinx role takes a CVE number as an argument and creates
a hyperlink to the relevant ISC Knowledgebase document that might have
more up-to-date or verbose information than the relevant release note.
This makes reaching ISC Knowledgebase pages directly from the release
notes easier.

Make all CVE references in the release notes use the new Sphinx role.

doc/arm/conf.py
doc/arm/reference.rst
doc/notes/notes-9.19.1.rst
doc/notes/notes-9.19.14.rst
doc/notes/notes-9.19.17.rst
doc/notes/notes-9.19.5.rst
doc/notes/notes-9.19.9.rst

index be3b0cc901920849fc60e369955c4a8ef89bd3c8..cc0a3e1ffe9510cc7f78db9e817df7f4efdcab9a 100644 (file)
@@ -40,6 +40,44 @@ except ImportError:
 
 
 GITLAB_BASE_URL = "https://gitlab.isc.org/isc-projects/bind9/-/"
+KNOWLEDGEBASE_BASE_URL = "https://kb.isc.org/docs/"
+
+
+# Custom Sphinx role enabling automatic hyperlinking to security advisory in
+# ISC Knowledgebase
+class CVERefRole(ReferenceRole):
+    def __init__(self, base_url: str) -> None:
+        self.base_url = base_url
+        super().__init__()
+
+    def run(self) -> Tuple[List[Node], List[system_message]]:
+        cve_identifier = "(CVE-%s)" % self.target
+
+        target_id = "index-%s" % self.env.new_serialno("index")
+        entries = [
+            ("single", "ISC Knowledgebase; " + cve_identifier, target_id, "", None)
+        ]
+
+        index = addnodes.index(entries=entries)
+        target = nodes.target("", "", ids=[target_id])
+        self.inliner.document.note_explicit_target(target)
+
+        try:
+            refuri = self.base_url + "cve-%s" % self.target
+            reference = nodes.reference(
+                "", "", internal=False, refuri=refuri, classes=["cve"]
+            )
+            if self.has_explicit_title:
+                reference += nodes.strong(self.title, self.title)
+            else:
+                reference += nodes.strong(cve_identifier, cve_identifier)
+        except ValueError:
+            error_text = "invalid ISC Knowledgebase identifier %s" % self.target
+            msg = self.inliner.reporter.error(error_text, line=self.lineno)
+            prb = self.inliner.problematic(self.rawtext, self.rawtext, msg)
+            return [prb], [msg]
+
+        return [index, target, reference], []
 
 
 # Custom Sphinx role enabling automatic hyperlinking to GitLab issues/MRs.
@@ -84,6 +122,7 @@ class GitLabRefRole(ReferenceRole):
 
 
 def setup(app):
+    roles.register_local_role("cve", CVERefRole(KNOWLEDGEBASE_BASE_URL))
     roles.register_local_role("gl", GitLabRefRole(GITLAB_BASE_URL))
     app.add_crossref_type("iscman", "iscman", "pair: %s; manual page")
 
index c26dbb6ddebcecba032feac8877caa8e78e7af76..3ec2fffb91ef0f412491c0a7627fdecace04e0bd 100644 (file)
@@ -4052,8 +4052,7 @@ Tuning
    :short: Sets the resolver's lame cache.
 
    This is always set to 0. More information is available in the
-   `security advisory for CVE-2021-25219
-   <https://kb.isc.org/docs/cve-2021-25219>`_.
+   security advisory for :cve:`2021-25219`.
 
 .. namedconf:statement:: servfail-ttl
    :tags: server
index dd778fb2123e5601d1ae94e0d309eeb22fcbb62e..9e364bcd7b81796c1ef6b6400565aaab2dbdf450 100644 (file)
@@ -20,7 +20,7 @@ Security Fixes
   DNS-over-HTTPS (DoH) clients. This has been fixed.
 
   ISC would like to thank Thomas Amgarten from arcade solutions ag for
-  bringing this vulnerability to our attention. (CVE-2022-1183)
+  bringing this vulnerability to our attention. :cve:`2022-1183`
   :gl:`#3216`
 
 New Features
index 3a270e5d79f2b45bff3b281e0783c670e7957aff..102a7f4d8385d89b7e4191b607b02cebb63f6f51 100644 (file)
@@ -17,7 +17,7 @@ Security Fixes
 
 - The overmem cleaning process has been improved, to prevent the cache from
   significantly exceeding the configured :any:`max-cache-size` limit.
-  (CVE-2023-2828)
+  :cve:`2023-2828`
 
   ISC would like to thank Shoham Danino from Reichman University, Anat
   Bremler-Barr from Tel-Aviv University, Yehuda Afek from Tel-Aviv University,
index 7081fa3e712dd6ef7daa65630f139554a3c27c6d..23f40700a9c8fda5975f48a86734cb82d07c4568 100644 (file)
@@ -18,7 +18,7 @@ Security Fixes
 - Previously, sending a specially crafted message over the control
   channel could cause the packet-parsing code to run out of available
   stack memory, causing :iscman:`named` to terminate unexpectedly.
-  This has been fixed. (CVE-2023-3341)
+  This has been fixed. :cve:`2023-3341`
 
   ISC would like to thank Eric Sesterhenn from X41 D-Sec GmbH for
   bringing this vulnerability to our attention. :gl:`#4152`
index 86c5a89be0504390b54066f827cfeb91e2ce1ec1..6095a15da4a28e2983e1200c881b3754f3b9b0b1 100644 (file)
@@ -18,7 +18,7 @@ Security Fixes
 - Previously, there was no limit to the number of database lookups
   performed while processing large delegations, which could be abused to
   severely impact the performance of :iscman:`named` running as a
-  recursive resolver. This has been fixed. (CVE-2022-2795)
+  recursive resolver. This has been fixed. :cve:`2022-2795`
 
   ISC would like to thank Yehuda Afek from Tel-Aviv University and Anat
   Bremler-Barr & Shani Stajnrod from Reichman University for bringing
@@ -27,20 +27,20 @@ Security Fixes
 - When an HTTP connection was reused to request statistics from the
   stats channel, the content length of successive responses could grow
   in size past the end of the allocated buffer. This has been fixed.
-  (CVE-2022-2881) :gl:`#3493`
+  :cve:`2022-2881` :gl:`#3493`
 
 - Memory leaks in code handling Diffie-Hellman (DH) keys were fixed that
   could be externally triggered, when using TKEY records in DH mode with
-  OpenSSL 3.0.0 and later versions. (CVE-2022-2906) :gl:`#3491`
+  OpenSSL 3.0.0 and later versions. :cve:`2022-2906` :gl:`#3491`
 
 - :iscman:`named` running as a resolver with the
   :any:`stale-answer-client-timeout` option set to ``0`` could crash
   with an assertion failure, when there was a stale CNAME in the cache
-  for the incoming query. This has been fixed. (CVE-2022-3080)
+  for the incoming query. This has been fixed. :cve:`2022-3080`
   :gl:`#3517`
 
 - Memory leaks were fixed that could be externally triggered in the
-  DNSSEC verification code for the EdDSA algorithm. (CVE-2022-38178)
+  DNSSEC verification code for the EdDSA algorithm. :cve:`2022-38178`
   :gl:`#3487`
 
 New Features
index 14a773f508b87a431ee12ab6cdf8ff769fc8593f..65a4e711ed5faf199f6776cfb53ccfcd87638b82 100644 (file)
@@ -19,14 +19,14 @@ Security Fixes
   available memory. This flaw was addressed by adding a new
   :any:`update-quota` option that controls the maximum number of
   outstanding DNS UPDATE messages that :iscman:`named` can hold in a
-  queue at any given time (default: 100). (CVE-2022-3094)
+  queue at any given time (default: 100). :cve:`2022-3094`
 
   ISC would like to thank Rob Schulhof from Infoblox for bringing this
   vulnerability to our attention. :gl:`#3523`
 
 - :iscman:`named` could crash with an assertion failure when an RRSIG
   query was received and :any:`stale-answer-client-timeout` was set to a
-  non-zero value. This has been fixed. (CVE-2022-3736)
+  non-zero value. This has been fixed. :cve:`2022-3736`
 
   ISC would like to thank Borja Marcos from Sarenet (with assistance by
   Iratxe Niño from Fundación Sarenet) for bringing this vulnerability to
@@ -36,7 +36,7 @@ Security Fixes
   :any:`stale-answer-client-timeout` option set to any value greater
   than ``0`` could crash with an assertion failure, when the
   :any:`recursive-clients` soft quota was reached. This has been fixed.
-  (CVE-2022-3924)
+  :cve:`2022-3924`
 
   ISC would like to thank Maksym Odinintsev from AWS for bringing this
   vulnerability to our attention. :gl:`#3619`