Skip to content

Commit

Permalink
Point people to the PSF Advisory Database
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson authored and vstinner committed Oct 1, 2023
1 parent 7f64729 commit 9e5aa35
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions render_doc.py
Expand Up @@ -21,6 +21,24 @@
# https://devguide.python.org/versions/
MAINTAINED_BRANCHES = ['3.7', '3.8', '3.9', '3.10']

PSF_ADVISORY_DATABASE = """
.. warning::
This resource is maintained for historical reference and **does not contain the latest vulnerability info for Python**.
The `canonical database for vulnerabilities affecting Python <https://github.com/psf/advisory-database>`_ is available on GitHub
in the Open Source Vulnerability (OSV) format. This database can be viewed online at the
`Open Source Vulnerability Database <https://osv.dev/list?ecosystem=&q=PSF>`_.
""".strip()

PSF_ADVISORY_DATABASE_WITH_CVE = """
.. warning::
This resource is maintained for historical reference and **does not contain the latest vulnerability info for Python**.
The `canonical database for vulnerabilities affecting Python <https://github.com/psf/advisory-database>`_ is available on GitHub
in the Open Source Vulnerability (OSV) format. This vulnerability can be viewed online at the
`Open Source Vulnerability Database <https://osv.dev/list?ecosystem=&q={cve}>`_.
""".strip()

STATUS_BRANCHES = """
`Status of Python branches
<https://devguide.python.org/versions/>`_ lists Python
Expand Down Expand Up @@ -1086,6 +1104,12 @@ def render_vuln(filename, vuln):

render_title(fp, vuln.name, '=')

if vuln.cve_list and len(vuln.cve_list) == 1:
print(PSF_ADVISORY_DATABASE_WITH_CVE.format(cve=vuln.cve_list[0].number), file=fp)
else:
print(PSF_ADVISORY_DATABASE, file=fp)
print(file=fp)

print(vuln.description, file=fp)
print(file=fp)
render_info(fp, vuln)
Expand Down Expand Up @@ -1254,6 +1278,9 @@ def main(self, yaml_filename, output_filename):
print("+" * len(title), file=fp)
print(file=fp)

print(PSF_ADVISORY_DATABASE, file=fp)
print(file=fp)

print(STATUS_BRANCHES, file=fp)
print(file=fp)

Expand Down

0 comments on commit 9e5aa35

Please sign in to comment.