Repository navigation
fix(automation): URL-encode reflected selected_items in export links - #8608
Closed
somethingwithproof wants to merge 11 commits into
Closed
somethingwithproof wants to merge 11 commits into
somethingwithproof wants to merge 11 commits into
Conversation
…tworks.php export (XSS)
…aph_rules.php export (XSS)
…mp.php export (XSS)
…ee_rules.php export (XSS)
…mplates.php export (XSS)
somethingwithproof
requested review from
cigamit
and removed request for
a team
November 6, 2026 08:44
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
|
Member
Author
|
Closing as superseded by #8448, which encodes the same export links from the validated value and also covers data_source_profiles.php and host_templates.php. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The automation list pages build a
DownloadStart('…?action=export&selected_items=' . get_nfilter_request_var('selected_items') . '…')link that reflects the rawselected_itemsrequest variable into an inline<script>string. A crafted value can break out of the single-quoted JS string (reflected XSS, authenticated).Fix: wrap the reflected value in
rawurlencode()on all five pages (automation_networks, automation_graph_rules, automation_snmp, automation_tree_rules, automation_templates). This neutralizes quotes/angle-brackets in both the JS-string and URL-parameter context, and round-trips correctly — theexportaction readsget_nfilter_request_var('selected_items')(URL-decoded) and re-sanitizes viasanitize_unserialize_selected_items()as before, so behavior is unchanged.Scope note: this reflect (the
DownloadStartpattern) exists ondevelop; the released 1.2.x pages do not reflect the raw value, so this is a develop-only hardening fix.