-
Notifications
You must be signed in to change notification settings - Fork 3.6k
HTML-encode TagHelper titles and texts for security #24488
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
base: rel-10.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances security by implementing HTML encoding for user-provided text content in TagHelper services across the ABP Framework. The changes prevent potential XSS vulnerabilities by ensuring all titles, texts, and captions rendered in HTML are properly encoded before being inserted into the DOM.
- Injected
HtmlEncoderinto TagHelper service constructors throughout the framework - Applied HTML encoding to all user-controlled text content (titles, captions, button text, etc.) before rendering
- Maintained consistent implementation patterns across related TagHelper services
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| AbpTagHelperStyleService.cs | Added HtmlEncoder parameter to constructor and passed it to base class |
| AbpTagHelperScriptService.cs | Added HtmlEncoder parameter to constructor and passed it to base class |
| AbpTabTagHelperService.cs | Added HtmlEncoder injection and applied encoding to tab titles |
| AbpTabLinkTagHelperService.cs | Added HtmlEncoder injection and applied encoding to tab link titles |
| AbpTabDropdownTagHelperService.cs | Added HtmlEncoder injection and applied encoding to dropdown titles |
| AbpModalHeaderTagHelperService.cs | Added HtmlEncoder injection and applied encoding to modal header titles |
| AbpRadioInputTagHelperService.cs | Added HtmlEncoder injection and applied encoding to radio button labels |
| AbpAccordionItemTagHelperService.cs | Added HtmlEncoder injection and applied encoding to accordion item titles |
| AbpCarouselItemTagHelperService.cs | Applied encoding to carousel captions and titles (encoder already present) |
| AbpCardBodyTagHelperService.cs | Added HtmlEncoder injection and applied encoding to card titles and subtitles |
| AbpLinkButtonTagHelperService.cs | Updated constructor to pass HtmlEncoder to base class |
| AbpButtonTagHelperServiceBase.cs | Added HtmlEncoder injection and applied encoding to button text |
| AbpButtonTagHelperService.cs | Updated constructor to pass HtmlEncoder to base class and accept it as parameter |
| AbpBreadcrumbItemTagHelperService.cs | Applied encoding to breadcrumb item titles (encoder already present) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...rk/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpRadioInputTagHelperService.cs
Outdated
Show resolved
Hide resolved
…Form/AbpRadioInputTagHelperService.cs Co-authored-by: Copilot <[email protected]>
No description provided.