Skip to content

Sanitize rendered custom link HTML #12205

@jeremystretch

Description

@jeremystretch

NetBox version

v3.4.7

Feature type

Change to existing functionality

Proposed functionality

Custom links enable users to craft customized buttons in the UI relevant to particular objects. Both the link URL and text can be rendered from a Jinja2 template.

This FR proposes sanitizing the rendered URL and text to guard against potentially malicious content. We should be able to utilize the clean_html() utility function already in place for this purpose. The sanitization would occur after either piece of content has been fully rendered by the Jinja2 engine.

Use case

Ensures well-formed content and mitigates the risk of users crafting malicious links.

Database changes

No response

External dependencies

No response

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions