CVE-2024-23345 (published 2024-01-23T00:15Z)

Nautobot is a Network Source of Truth and Network Automation Platform built as a web application.  All users of Nautobot versions earlier than 1.6.10 or 2.1.2 are potentially impacted by a cross-site scripting vulnerability. Due to inadequate input sanitization, any user-editable fields that support Markdown rendering, including are potentially susceptible to cross-site scripting (XSS) attacks via maliciously crafted data. This issue is fixed in Nautobot versions 1.6.10 and 2.1.2.

CVSS v3 base score: 5.4, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N)

Weakness information:
cwe_id: CWE-79
cwe_name: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
description: The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
extended_description: 
            Cross-site scripting (XSS) vulnerabilities occur when:
            
               Untrusted data enters a web application, typically from a web request.
               The web application dynamically generates a web page that contains this untrusted data.
               During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
               A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
               Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain.
               This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain.
            
            There are three main kinds of XSS:
            
               
                  Type 1: Reflected XSS (or Non-Persistent) - 
         			The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
               
                  Type 2: Stored XSS (or Persistent) - 
               The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs.
            
               
                  Type 0: DOM-Based XSS - 
               In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
            
            
            Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as "drive-by hacking."
            In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.
         
         

Fix information:
repo_url: https://github.com/nautobot/nautobot
commit_details: repo_url: https://github.com/nautobot/nautobot
author: Glenn Matthews
author_date: 2024-01-19 16:37:24-05:00
msg: Sanitize `render_markdown()` output with `nh3` library (#5133)

* Fix GHSA-v4xv-795h-rv4h.

* Renumber change fragments

* Address review feedback

* Test fix

* Ruff

* Review feedback

* Update nautobot/core/forms/fields.py
repository: repo_url: https://github.com/nautobot/nautobot
repo_name: nautobot/nautobot
description: Network Source of Truth & Network Automation Platform
repo_language: Python
owner: nautobot
file_changes: filename: 5133.added
change_type: ModificationType.ADD
diff: @@ -0,0 +1 @@
+Enhanced Markdown-supporting fields (`comments`, `description`, Notes, Job log entries, etc.) to also permit the use of a limited subset of "safe" HTML tags and attributes.

programming_language: Batchfile
filename: 5133.dependencies
change_type: ModificationType.ADD
diff: @@ -0,0 +1 @@
+Added `nh3` HTML sanitization library as a dependency.

programming_language: SQL
filename: 5133.security
change_type: ModificationType.ADD
diff: @@ -0,0 +1 @@
+Fixed an XSS vulnerability ([GHSA-v4xv-795h-rv4h](https://github.com/nautobot/nautobot/security/advisories/GHSA-v4xv-795h-rv4h)) in the `render_markdown()` utility function used to render comments, notes, job log entries, etc.

programming_language: Markdown
filename: constants.py
change_type: ModificationType.MODIFY
diff: @@ -1,3 +1,7 @@
+from copy import deepcopy
+
+import nh3
+
 SEARCH_MAX_RESULTS = 15
 
 #
@@ -32,6 +36,35 @@ FILTER_NUMERIC_BASED_LOOKUP_MAP = {
 
 FILTER_NEGATION_LOOKUP_MAP = {"n": "exact"}
 
+#
+# User input sanitization
+#
+
+# Subset of the HTML tags allowed by default by ammonia:
+# https://github.com/rust-ammonia/ammonia/blob/master/src/lib.rs
+HTML_ALLOWED_TAGS = nh3.ALLOWED_TAGS - {
+    # no image maps at present
+    "area",
+    "map",
+    # no document-level markup at present
+    "article",
+    "aside",
+    "footer",
+    "header",
+    "nav",
+    # miscellaneous out-of-scope for now
+    "data",
+    "dfn",
+    "figcaption",
+    "figure",
+}
+
+# Variant of the HTML attributes allowed by default by ammonia:
+# https://github.com/rust-ammonia/ammonia/blob/master/src/lib.rs
+# at present we just copy nh3.ALLOWED_ATTRIBUTES but we can modify this later as desired and appropriate
+HTML_ALLOWED_ATTRIBUTES = deepcopy(nh3.ALLOWED_ATTRIBUTES)
+
+
 #
 # Reserved Names
 #

programming_language: Python
filename: fields.py
change_type: ModificationType.MODIFY
diff: @@ -9,7 +9,9 @@ from django.contrib.postgres.forms import SimpleArrayField
 from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist, ValidationError
 from django.db.models import Q
 from django.forms.fields import BoundField, InvalidJSONInput, JSONField as _JSONField
+from django.templatetags.static import static
 from django.urls import reverse
+from django.utils.html import format_html
 import django_filters
 from netaddr import EUI
 from netaddr.core import AddrFormatError
@@ -372,12 +374,16 @@ class CommentField(django_forms.CharField):
 
     widget = django_forms.Textarea
     default_label = ""
-    # TODO: Port Markdown cheat sheet to internal documentation
-    default_helptext = (
-        '<i class="mdi mdi-information-outline"></i> '
-        '<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">'
-        "Markdown</a> syntax is supported"
-    )
+
+    @property
+    def default_helptext(self):
+        # TODO: Port Markdown cheat sheet to internal documentation
+        return format_html(
+            '<i class="mdi mdi-information-outline"></i> '
+            '<a href="https://www.markdownguide.org/cheat-sheet/#basic-syntax" rel="noopener noreferrer">Markdown</a> '
+            'syntax is supported, as well as <a href="{}#render_markdown">a limited subset of HTML</a>.',
+            static("docs/user-guide/platform-functionality/template-filters.html"),
+        )
 
     def __init__(self, *args, **kwargs):
         required = kwargs.pop("required", False)

programming_language: Python
filename: settings.py
change_type: ModificationType.MODIFY
diff: @@ -682,7 +682,8 @@ CONSTANCE_CONFIG = {
     ),
     "SUPPORT_MESSAGE": ConstanceConfigItem(
         default="",
-        help_text="Help message to include on 4xx and 5xx error pages. Markdown is supported.\n"
+        help_text="Help message to include on 4xx and 5xx error pages. "
+        "Markdown is supported, as are some HTML tags and attributes.\n"
         "If unspecified, instructions to join Network to Code's Slack community will be provided.",
     ),
 }

programming_language: Python
filename: helpers.py
change_type: ModificationType.MODIFY
diff: @@ -8,7 +8,7 @@ from django.conf import settings
 from django.contrib.staticfiles.finders import find
 from django.templatetags.static import static, StaticNode
 from django.urls import NoReverseMatch, reverse
-from django.utils.html import format_html, strip_tags
+from django.utils.html import format_html
 from django.utils.safestring import mark_safe
 from django.utils.text import slugify as django_slugify
 from django_jinja import library
@@ -17,7 +17,7 @@ import yaml
 
 from nautobot.apps.config import get_app_settings_or_config
 from nautobot.core import forms
-from nautobot.core.utils import color, config, data, lookup
+from nautobot.core.utils import color, config, data, logging as nautobot_logging, lookup
 from nautobot.core.utils.requests import add_nautobot_version_query_param_to_url
 
 # S308 is suspicious-mark-safe-usage, but these are all using static strings that we know to be safe
@@ -170,17 +170,12 @@ def render_markdown(value):
     Example:
         {{ text | render_markdown }}
     """
-    # Strip HTML tags
-    value = strip_tags(value)
-
-    # Sanitize Markdown links
-    schemes = "|".join(settings.ALLOWED_URL_SCHEMES)
-    pattern = rf"\[(.+)\]\((?!({schemes})).*:(.+)\)"
-    value = re.sub(pattern, "[\\1](\\3)", value, flags=re.IGNORECASE)
-
     # Render Markdown
     html = markdown(value, extensions=["fenced_code", "tables"])
 
+    # Sanitize rendered HTML
+    html = nautobot_logging.clean_html(html)
+
     return mark_safe(html)  # noqa: S308  # suspicious-mark-safe-usage, OK here since we sanitized the string earlier
 
 

programming_language: Python
filename: test_templatetags_helpers.py
change_type: ModificationType.MODIFY
diff: @@ -79,9 +79,24 @@ class NautobotTemplatetagsHelperTest(TestCase):
             helpers.render_markdown("**bold and _italics_**"), "<p><strong>bold and <em>italics</em></strong></p>"
         )
         self.assertEqual(helpers.render_markdown("* list"), "<ul>\n<li>list</li>\n</ul>")
-        self.assertEqual(
+        self.assertHTMLEqual(
             helpers.render_markdown("[I am a link](https://www.example.com)"),
-            '<p><a href="https://www.example.com">I am a link</a></p>',
+            '<p><a href="https://www.example.com" rel="noopener noreferrer">I am a link</a></p>',
+        )
+
+    def test_render_markdown_security(self):
+        self.assertEqual(helpers.render_markdown('<script>alert("XSS")</script>'), "")
+        self.assertHTMLEqual(
+            helpers.render_markdown('[link](javascript:alert("XSS"))'),
+            '<p><a title="XSS" rel="noopener noreferrer">link</a>)</p>',  # the trailing ) seems weird to me, but...
+        )
+        self.assertHTMLEqual(
+            helpers.render_markdown(
+                "[link\nJS]"
+                "(&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A"  # '(javascript:'
+                "&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29)"  # 'alert("XSS"))'
+            ),
+            '<p><a rel="noopener noreferrer">link JS</a></p>',
         )
 
     def test_render_json(self):
@@ -240,8 +255,8 @@ class NautobotTemplatetagsHelperTest(TestCase):
                 self.assertHTMLEqual(
                     helpers.support_message(),
                     "<p>If further assistance is required, please join the <code>#nautobot</code> channel "
-                    'on <a href="https://slack.networktocode.com/">Network to Code\'s Slack community</a> '
-                    "and post your question.</p>",
+                    'on <a href="https://slack.networktocode.com/" rel="noopener noreferrer">Network to Code\'s '
+                    "Slack community</a> and post your question.</p>",
                 )
 
             with override_config(SUPPORT_MESSAGE="Reach out to your support team for assistance."):

programming_language: Python
filename: test_views.py
change_type: ModificationType.MODIFY
diff: @@ -366,9 +366,9 @@ class ErrorPagesTestCase(TestCase):
         self.assertContains(response, "Network to Code", status_code=404)
         response_content = response.content.decode(response.charset)
         self.assertInHTML(
-            "If further assistance is required, please join the <code>#nautobot</code> channel "
-            'on <a href="https://slack.networktocode.com/">Network to Code\'s Slack community</a> '
-            "and post your question.",
+            "If further assistance is required, please join the <code>#nautobot</code> channel on "
+            '<a href="https://slack.networktocode.com/" rel="noopener noreferrer">Network to Code\'s '
+            "Slack community</a> and post your question.",
             response_content,
         )
 
@@ -392,16 +392,16 @@ class ErrorPagesTestCase(TestCase):
         self.assertContains(response, "Network to Code", status_code=500)
         response_content = response.content.decode(response.charset)
         self.assertInHTML(
-            "If further assistance is required, please join the <code>#nautobot</code> channel "
-            'on <a href="https://slack.networktocode.com/">Network to Code\'s Slack community</a> '
-            "and post your question.",
+            "If further assistance is required, please join the <code>#nautobot</code> channel on "
+            '<a href="https://slack.networktocode.com/" rel="noopener noreferrer">Network to Code\'s '
+            "Slack community</a> and post your question.",
             response_content,
         )
 
     @override_settings(DEBUG=False, SUPPORT_MESSAGE="Hello world!")
     @mock.patch("nautobot.core.views.HomeView.get", side_effect=Exception)
     def test_500_custom_support_message(self, mock_get):
-        """Nautobot's custom 500 page should be used and should include a default support message."""
+        """Nautobot's custom 500 page should be used and should include a custom support message if defined."""
         url = reverse("home")
         with self.assertTemplateUsed("500.html"):
             self.client.raise_request_exception = False

programming_language: Python
filename: logging.py
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,12 @@
-"""Utilities for working with log messages and similar features."""
+"""Utilities for working with log messages and similar user-authored data."""
 
 import logging
 import re
 
 from django.conf import settings
+import nh3
+
+from nautobot.core import constants
 
 logger = logging.getLogger(__name__)
 
@@ -47,3 +50,13 @@ def sanitize(dirty, replacement="(redacted)"):
 
     logger.warning("No sanitizer support for %s data", type(dirty))
     return dirty
+
+
+def clean_html(html):
+    """Use nh3/ammonia to strip out all HTML tags and attributes except those explicitly permitted."""
+    return nh3.clean(
+        html,
+        tags=constants.HTML_ALLOWED_TAGS,
+        attributes=constants.HTML_ALLOWED_ATTRIBUTES,
+        url_schemes=set(settings.ALLOWED_URL_SCHEMES),
+    )

programming_language: Python
filename: index.md
change_type: ModificationType.MODIFY
diff: @@ -113,7 +113,7 @@ This is the human-friendly name of your job, as will be displayed in the Nautobo
 #### `description`
 
 An optional human-friendly description of what this job does.
-This can accept either plain text or Markdown-formatted text. It can also be multiple lines:
+This can accept either plain text, Markdown-formatted text, or [a limited subset of HTML](../../user-guide/platform-functionality/template-filters.md#render_markdown). It can also be multiple lines:
 
 ```python
 class ExampleJob(Job):
@@ -512,7 +512,7 @@ To skip writing a log entry to the database, set the `skip_db_logging` key in th
             logger.info("This job is running!", extra={"skip_db_logging": True})
     ```
 
-Markdown rendering is supported for log messages.
+Markdown rendering is supported for log messages, as well as [a limited subset of HTML](../../user-guide/platform-functionality/template-filters.md#render_markdown).
 
 +/- 1.3.4
     As a security measure, the `message` passed to any of these methods will be passed through the `nautobot.core.utils.logging.sanitize()` function in an attempt to strip out information such as usernames/passwords that should not be saved to the logs. This is of course best-effort only, and Job authors should take pains to ensure that such information is not passed to the logging APIs in the first place. The set of redaction rules used by the `sanitize()` function can be configured as [settings.SANITIZER_PATTERNS](../../user-guide/administration/configuration/optional-settings.md#sanitizer_patterns).

programming_language: Markdown
filename: optional-settings.md
change_type: ModificationType.MODIFY
diff: @@ -964,7 +964,7 @@ If set to `False`, unknown/unrecognized filter parameters will be discarded and
 
 Default: `""`
 
-A message to include on error pages (status code 403, 404, 500, etc.) when an error occurs. You can configure this to direct users to the appropriate contact(s) within your organization that provide support for Nautobot. Markdown formatting is supported within this message (raw HTML is not).
+A message to include on error pages (status code 403, 404, 500, etc.) when an error occurs. You can configure this to direct users to the appropriate contact(s) within your organization that provide support for Nautobot. Markdown formatting is supported within this message, as well as [a limited subset of HTML](../../platform-functionality/template-filters.md#render_markdown).
 
 If unset, the default message that will appear is `If further assistance is required, please join the #nautobot channel on [Network to Code's Slack community](https://slack.networktocode.com) and post your question.`
 

programming_language: Markdown
filename: note.md
change_type: ModificationType.MODIFY
diff: @@ -4,4 +4,4 @@
 
 Notes provide a place for you to store notes or general information on an object, such as a Device, that may not require a specific field for. This could be a note on a recent upgrade, a warning about a problematic device, or the reason the Rack was marked with the Status `Retired`.
 
-The note field supports [Markdown Basic Syntax](https://www.markdownguide.org/cheat-sheet/#basic-syntax).
+The note field supports [Markdown Basic Syntax](https://www.markdownguide.org/cheat-sheet/#basic-syntax) as well as [a limited subset of HTML](template-filters.md#render_markdown).

programming_language: Markdown
filename: template-filters.md
change_type: ModificationType.MODIFY
diff: @@ -216,12 +216,86 @@ Render a dictionary as formatted JSON.
 
 ### render_markdown
 
-Render text as Markdown.
+Render and sanitize Markdown text into HTML. A limited subset of HTML tags and attributes are permitted in the text as well; non-permitted HTML will be stripped from the output for security.
 
 ```django
 {{ text | render_markdown }}
 ```
 
+#### Permitted HTML Tags and Attributes
+
++++ 2.1.2
+
+The set of permitted HTML tags is defined in `nautobot.core.constants.HTML_ALLOWED_TAGS`, and their permitted attributes are defined in `nautobot.core.constants.HTML_ALLOWED_ATTRIBUTES`. As of Nautobot 2.1.2 the following are permitted:
+
+??? info "Full list of HTML tags and attributes"
+    | Tag            | Attributes                                                           |
+    | -------------- | -------------------------------------------------------------------- |
+    | `<a>`          | `href`, `hreflang`                                                   |
+    | `<abbr>`       |                                                                      |
+    | `<acronym>`    |                                                                      |
+    | `<b>`          |                                                                      |
+    | `<bdi>`        |                                                                      |
+    | `<bdo>`        | `dir`                                                                |
+    | `<blockquote>` | `cite`                                                               |
+    | `<br>`         |                                                                      |
+    | `<caption>`    |                                                                      |
+    | `<center>`     |                                                                      |
+    | `<cite>`       |                                                                      |
+    | `<code>`       |                                                                      |
+    | `<col>`        | `align`, `char`, `charoff`, `span`                                   |
+    | `<colgroup>`   | `align`, `char`, `charoff`, `span`                                   |
+    | `<dd>`         |                                                                      |
+    | `<del>`        | `cite`, `datetime`                                                   |
+    | `<details>`    |                                                                      |
+    | `<div>`        |                                                                      |
+    | `<dl>`         |                                                                      |
+    | `<dt>`         |                                                                      |
+    | `<em>`         |                                                                      |
+    | `<h1>`         |                                                                      |
+    | `<h2>`         |                                                                      |
+    | `<h3>`         |                                                                      |
+    | `<h4>`         |                                                                      |
+    | `<h5>`         |                                                                      |
+    | `<h6>`         |                                                                      |
+    | `<hgroup>`     |                                                                      |
+    | `<hr>`         | `align`, `size`, `width`                                             |
+    | `<i>`          |                                                                      |
+    | `<img>`        | `align`, `alt`, `height`, `src`, `width`                             |
+    | `<ins>`        | `cite`, `datetime`                                                   |
+    | `<kbd>`        |                                                                      |
+    | `<li>`         |                                                                      |
+    | `<mark>`       |                                                                      |
+    | `<ol>`         | `start`                                                              |
+    | `<p>`          |                                                                      |
+    | `<pre>`        |                                                                      |
+    | `<q>`          | `cite`                                                               |
+    | `<rp>`         |                                                                      |
+    | `<rt>`         |                                                                      |
+    | `<rtc>`        |                                                                      |
+    | `<ruby>`       |                                                                      |
+    | `
`          |                                                                      |
+    | `<samp>`       |                                                                      |
+    | `<small>`      |                                                                      |
+    | `<span>`       |                                                                      |
+    | `<strike>`     |                                                                      |
+    | `<strong>`     |                                                                      |
+    | `<sub>`        |                                                                      |
+    | `<summary>`    |                                                                      |
+    | `<sup>`        |                                                                      |
+    | `<table>`      | `align`, `char`, `charoff`, `summary`                                |
+    | `<tbody>`      | `align`, `char`, `charoff`                                           |
+    | `<td>`         | `align`, `char`, `charoff`, `colspan`, `headers`, `rowspan`          |
+    | `<th>`         | `align`, `char`, `charoff`, `colspan`, `headers`, `rowspan`, `scope` |
+    | `<thead>`      | `align`, `char`, `charoff`                                           |
+    | `<time>`       |                                                                      |
+    | `<tr>`         | `align`, `char`, `charoff`                                           |
+    | `<tt>`         |                                                                      |
+    | `<u>`          |                                                                      |
+    | `<ul>`         |                                                                      |
+    | `<var>`        |                                                                      |
+    | `<wbr>`        |                                                                      |
+
 ### render_yaml
 
 Render a dictionary as formatted YAML.

programming_language: Markdown
filename: forms.py
change_type: ModificationType.MODIFY
diff: @@ -368,6 +368,12 @@ CustomFieldChoiceFormSet = inlineformset_factory(
 )
 
 
+class CustomFieldDescriptionField(CommentField):
+    @property
+    def default_helptext(self):
+        return "Also used as the help text when editing models using this custom field.<br>" + super().default_helptext
+
+
 class CustomFieldForm(BootstrapMixin, forms.ModelForm):
     label = forms.CharField(required=True, max_length=50, help_text="Name of the field as displayed to users.")
     key = SlugField(
@@ -376,11 +382,9 @@ class CustomFieldForm(BootstrapMixin, forms.ModelForm):
         slug_source="label",
         help_text="Internal name of this field. Please use underscores rather than dashes.",
     )
-    description = forms.CharField(
+    description = CustomFieldDescriptionField(
+        label="Description",
         required=False,
-        help_text="Also used as the help text when editing models using this custom field.<br>"
-        '<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">'
-        "Markdown</a> syntax is supported.",
     )
     content_types = MultipleContentTypeField(
         feature="custom_fields", help_text="The object(s) to which this field applies."
@@ -1098,7 +1102,7 @@ class JobButtonFilterForm(BootstrapMixin, forms.Form):
 
 
 class NoteForm(BootstrapMixin, forms.ModelForm):
-    note = CommentField
+    note = CommentField()
 
     class Meta:
         model = Note

programming_language: Python
filename: jobs.py
change_type: ModificationType.MODIFY
diff: @@ -108,7 +108,10 @@ class Job(PrimaryModel):
         help_text="Human-readable name of this job",
         unique=True,
     )
-    description = models.TextField(blank=True, help_text="Markdown formatting is supported")
+    description = models.TextField(
+        blank=True,
+        help_text="Markdown formatting and a limited subset of HTML are supported",
+    )
 
     # Control flags
     installed = models.BooleanField(

programming_language: Python
filename: poetry.lock
change_type: ModificationType.MODIFY
diff: @@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
+# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand.
 
 [[package]]
 name = "amqp"
@@ -1642,6 +1642,7 @@ description = "Powerful and Pythonic XML processing library combining libxml2/li
 optional = true
 python-versions = ">=3.6"
 files = [
+    {file = "lxml-5.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:704f5572ff473a5f897745abebc6df40f22d4133c1e0a1f124e4f2bd3330ff7e"},
     {file = "lxml-5.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9d3c0f8567ffe7502d969c2c1b809892dc793b5d0665f602aad19895f8d508da"},
     {file = "lxml-5.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5fcfbebdb0c5d8d18b84118842f31965d59ee3e66996ac842e21f957eb76138c"},
     {file = "lxml-5.1.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2f37c6d7106a9d6f0708d4e164b707037b7380fcd0b04c5bd9cae1fb46a856fb"},
@@ -1651,6 +1652,7 @@ files = [
     {file = "lxml-5.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:82bddf0e72cb2af3cbba7cec1d2fd11fda0de6be8f4492223d4a268713ef2147"},
     {file = "lxml-5.1.0-cp310-cp310-win32.whl", hash = "sha256:b66aa6357b265670bb574f050ffceefb98549c721cf28351b748be1ef9577d93"},
     {file = "lxml-5.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:4946e7f59b7b6a9e27bef34422f645e9a368cb2be11bf1ef3cafc39a1f6ba68d"},
+    {file = "lxml-5.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:14deca1460b4b0f6b01f1ddc9557704e8b365f55c63070463f6c18619ebf964f"},
     {file = "lxml-5.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ed8c3d2cd329bf779b7ed38db176738f3f8be637bb395ce9629fc76f78afe3d4"},
     {file = "lxml-5.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:436a943c2900bb98123b06437cdd30580a61340fbdb7b28aaf345a459c19046a"},
     {file = "lxml-5.1.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:acb6b2f96f60f70e7f34efe0c3ea34ca63f19ca63ce90019c6cbca6b676e81fa"},
@@ -1660,6 +1662,7 @@ files = [
     {file = "lxml-5.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f4c9bda132ad108b387c33fabfea47866af87f4ea6ffb79418004f0521e63204"},
     {file = "lxml-5.1.0-cp311-cp311-win32.whl", hash = "sha256:bc64d1b1dab08f679fb89c368f4c05693f58a9faf744c4d390d7ed1d8223869b"},
     {file = "lxml-5.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:a5ab722ae5a873d8dcee1f5f45ddd93c34210aed44ff2dc643b5025981908cda"},
+    {file = "lxml-5.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9aa543980ab1fbf1720969af1d99095a548ea42e00361e727c58a40832439114"},
     {file = "lxml-5.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6f11b77ec0979f7e4dc5ae081325a2946f1fe424148d3945f943ceaede98adb8"},
     {file = "lxml-5.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a36c506e5f8aeb40680491d39ed94670487ce6614b9d27cabe45d94cd5d63e1e"},
     {file = "lxml-5.1.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f643ffd2669ffd4b5a3e9b41c909b72b2a1d5e4915da90a77e119b8d48ce867a"},
@@ -1685,8 +1688,8 @@ files = [
     {file = "lxml-5.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8f52fe6859b9db71ee609b0c0a70fea5f1e71c3462ecf144ca800d3f434f0764"},
     {file = "lxml-5.1.0-cp37-cp37m-win32.whl", hash = "sha256:d42e3a3fc18acc88b838efded0e6ec3edf3e328a58c68fbd36a7263a874906c8"},
     {file = "lxml-5.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:eac68f96539b32fce2c9b47eb7c25bb2582bdaf1bbb360d25f564ee9e04c542b"},
+    {file = "lxml-5.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ae15347a88cf8af0949a9872b57a320d2605ae069bcdf047677318bc0bba45b1"},
     {file = "lxml-5.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c26aab6ea9c54d3bed716b8851c8bfc40cb249b8e9880e250d1eddde9f709bf5"},
-    {file = "lxml-5.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cfbac9f6149174f76df7e08c2e28b19d74aed90cad60383ad8671d3af7d0502f"},
     {file = "lxml-5.1.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:342e95bddec3a698ac24378d61996b3ee5ba9acfeb253986002ac53c9a5f6f84"},
     {file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:725e171e0b99a66ec8605ac77fa12239dbe061482ac854d25720e2294652eeaa"},
     {file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d184e0d5c918cff04cdde9dbdf9600e960161d773666958c9d7b565ccc60c45"},
@@ -1694,6 +1697,7 @@ files = [
     {file = "lxml-5.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6d48fc57e7c1e3df57be5ae8614bab6d4e7b60f65c5457915c26892c41afc59e"},
     {file = "lxml-5.1.0-cp38-cp38-win32.whl", hash = "sha256:7ec465e6549ed97e9f1e5ed51c657c9ede767bc1c11552f7f4d022c4df4a977a"},
     {file = "lxml-5.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:b21b4031b53d25b0858d4e124f2f9131ffc1530431c6d1321805c90da78388d1"},
+    {file = "lxml-5.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:52427a7eadc98f9e62cb1368a5079ae826f94f05755d2d567d93ee1bc3ceb354"},
     {file = "lxml-5.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6a2a2c724d97c1eb8cf966b16ca2915566a4904b9aad2ed9a09c748ffe14f969"},
     {file = "lxml-5.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:843b9c835580d52828d8f69ea4302537337a21e6b4f1ec711a52241ba4a824f3"},
     {file = "lxml-5.1.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9b99f564659cfa704a2dd82d0684207b1aadf7d02d33e54845f9fc78e06b7581"},
@@ -2171,6 +2175,31 @@ files = [
 [package.extras]
 optionals = ["jsonschema (>=4.17.3,<5.0.0)", "napalm (>=4.0.0,<5.0.0)"]
 
+[[package]]
+name = "nh3"
+version = "0.2.15"
+description = "Python bindings to the ammonia HTML sanitization library."
+optional = false
+python-versions = "*"
+files = [
+    {file = "nh3-0.2.15-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:9c0d415f6b7f2338f93035bba5c0d8c1b464e538bfbb1d598acd47d7969284f0"},
+    {file = "nh3-0.2.15-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:6f42f99f0cf6312e470b6c09e04da31f9abaadcd3eb591d7d1a88ea931dca7f3"},
+    {file = "nh3-0.2.15-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac19c0d68cd42ecd7ead91a3a032fdfff23d29302dbb1311e641a130dfefba97"},
+    {file = "nh3-0.2.15-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f0d77272ce6d34db6c87b4f894f037d55183d9518f948bba236fe81e2bb4e28"},
+    {file = "nh3-0.2.15-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:8d595df02413aa38586c24811237e95937ef18304e108b7e92c890a06793e3bf"},
+    {file = "nh3-0.2.15-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86e447a63ca0b16318deb62498db4f76fc60699ce0a1231262880b38b6cff911"},
+    {file = "nh3-0.2.15-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3277481293b868b2715907310c7be0f1b9d10491d5adf9fce11756a97e97eddf"},
+    {file = "nh3-0.2.15-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:60684857cfa8fdbb74daa867e5cad3f0c9789415aba660614fe16cd66cbb9ec7"},
+    {file = "nh3-0.2.15-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3b803a5875e7234907f7d64777dfde2b93db992376f3d6d7af7f3bc347deb305"},
+    {file = "nh3-0.2.15-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:0d02d0ff79dfd8208ed25a39c12cbda092388fff7f1662466e27d97ad011b770"},
+    {file = "nh3-0.2.15-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:f3b53ba93bb7725acab1e030bc2ecd012a817040fd7851b332f86e2f9bb98dc6"},
+    {file = "nh3-0.2.15-cp37-abi3-musllinux_1_2_i686.whl", hash = "sha256:b1e97221cedaf15a54f5243f2c5894bb12ca951ae4ddfd02a9d4ea9df9e1a29d"},
+    {file = "nh3-0.2.15-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a5167a6403d19c515217b6bcaaa9be420974a6ac30e0da9e84d4fc67a5d474c5"},
+    {file = "nh3-0.2.15-cp37-abi3-win32.whl", hash = "sha256:427fecbb1031db085eaac9931362adf4a796428ef0163070c484b5a768e71601"},
+    {file = "nh3-0.2.15-cp37-abi3-win_amd64.whl", hash = "sha256:bc2d086fb540d0fa52ce35afaded4ea526b8fc4d3339f783db55c95de40ef02e"},
+    {file = "nh3-0.2.15.tar.gz", hash = "sha256:d1e30ff2d8d58fb2a14961f7aac1bbb1c51f9bdd7da727be35c63826060b0bf3"},
+]
+
 [[package]]
 name = "ntc-templates"
 version = "4.1.0"
@@ -2428,7 +2457,6 @@ files = [
     {file = "psycopg2_binary-2.9.9-cp311-cp311-win32.whl", hash = "sha256:dc4926288b2a3e9fd7b50dc6a1909a13bbdadfc67d93f3374d984e56f885579d"},
     {file = "psycopg2_binary-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:b76bedd166805480ab069612119ea636f5ab8f8771e640ae103e05a4aae3e417"},
     {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:8532fd6e6e2dc57bcb3bc90b079c60de896d2128c5d9d6f24a63875a95a088cf"},
-    {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0605eaed3eb239e87df0d5e3c6489daae3f7388d455d0c0b4df899519c6a38d"},
     {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f8544b092a29a6ddd72f3556a9fcf249ec412e10ad28be6a0c0d948924f2212"},
     {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2d423c8d8a3c82d08fe8af900ad5b613ce3632a1249fd6a223941d0735fce493"},
     {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e5afae772c00980525f6d6ecf7cbca55676296b580c0e6abb407f15f3706996"},
@@ -2437,8 +2465,6 @@ files = [
     {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:cb16c65dcb648d0a43a2521f2f0a2300f40639f6f8c1ecbc662141e4e3e1ee07"},
     {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:911dda9c487075abd54e644ccdf5e5c16773470a6a5d3826fda76699410066fb"},
     {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:57fede879f08d23c85140a360c6a77709113efd1c993923c59fde17aa27599fe"},
-    {file = "psycopg2_binary-2.9.9-cp312-cp312-win32.whl", hash = "sha256:64cf30263844fa208851ebb13b0732ce674d8ec6a0c86a4e160495d299ba3c93"},
-    {file = "psycopg2_binary-2.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:81ff62668af011f9a48787564ab7eded4e9fb17a4a6a74af5ffa6a457400d2ab"},
     {file = "psycopg2_binary-2.9.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2293b001e319ab0d869d660a704942c9e2cce19745262a8aba2115ef41a0a42a"},
     {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:03ef7df18daf2c4c07e2695e8cfd5ee7f748a1d54d802330985a78d2a5a6dca9"},
     {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a602ea5aff39bb9fac6308e9c9d82b9a35c2bf288e184a816002c9fae930b77"},
@@ -3957,4 +3983,4 @@ sso = ["social-auth-core"]
 [metadata]
 lock-version = "2.0"
 python-versions = ">=3.8,<3.12"
-content-hash = "8138e21579db269494e43aa441e2690b0bf838b58c6cce161dcb9f4cd1852640"
+content-hash = "136fa4c518d4206074a6f43319274580a9fd1c9ccc7e32b8045e767a0f8bcd12"

programming_language: Lua
filename: pyproject.toml
change_type: ModificationType.MODIFY
diff: @@ -112,6 +112,8 @@ netaddr = "~0.8.0"
 # Note: netutils is limited in scope, dependencies, and observes semver, as such
 #       we permit a looser (^) version constraint here.
 netutils = "^1.6.0"
+# HTML sanitization
+nh3 = "~0.2.15"
 # Handling of version numbers
 packaging = ">=23.1"
 # Image processing library

programming_language: Python