Conversation
…HTML notification emails Strip markdown/HTML link syntax characters ([, ], (, ), <, >) from display names returned by NicknameDriver, and insert a zero-width space after dots to break domain autolinks (e.g. nasty.com). Also adds a not_regex validation rule to reject these characters at save time, so the driver-level stripping only needs to handle nicknames saved before this fix. Relates to GHSA-3c4m-j3g4-hh25 (the 1.x advisory); this is the equivalent fix for 2.x, which additionally renders display names through a markdown formatter before output in HTML email bodies.
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.
Summary
Fixes #4399. Port of the GHSA-3c4m-j3g4-hh25 fix from 1.x (nicknames v1.8.3) adapted for 2.x's additional HTML email rendering context.
2.x sends HTML notification emails where display names are:
$formatter->convert()(markdown→HTML), allowing[CLICK](https://evil.com)to become a live<a>tag{!! !!}in the greeting template, allowing raw HTML injectionChanges:
NicknameDriver::displayName()— strips[,],(,),<,>from the returned name (neutralises markdown/HTML link syntax), and inserts a zero-width space after every.(breaksnasty.comdomain autolinks). Covers nicknames stored before the validation rule existed.UserResourceFields— addsnot_regex:/[\[\]()<>]/as a hard validation rule so these characters are rejected at save time going forward.Test plan
NicknameDriversanitization (10 cases: clean names, dots, brackets, parens, angle brackets, full markdown link syntax, username fallback)jane.smithstill saves successfully