-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sanitize rendered custom link HTML #12205
Comments
Sorry, but I just noticed that my commit has a bug that encodes '%' and '=', so links with GET parameters or URL encoded values would be failing. I believe this line - 89fa546#diff-7cd550a7e9a8bf633ee98ba17fdb140a64186bf257070850a6edc93e09b00004R282
Would need to add '%=' to
|
Should we create a separate issue to resolve that issue or re-open this ticket? |
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
The text was updated successfully, but these errors were encountered: