Skip to content
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

forms: FeedbackLabel: display unescaped description (sanitized HTML) #281

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

ptamarit
Copy link
Member

❤️ Thank you for your contribution!

Description

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@ptamarit ptamarit force-pushed the 1135-links-in-description branch from 0939796 to 0d2027f Compare March 25, 2025 09:47
@ptamarit ptamarit force-pushed the 1135-links-in-description branch from 0d2027f to 28454ab Compare March 25, 2025 10:02
// This field is sanitized in the backend with SanitizedHTML.
content={
<span
dangerouslySetInnerHTML={{ __html: severityInfo.severityDescription }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general we try to avoid to use dangerouslySetInnerHTML, I guess we are sure there is no securiy issue

Copy link
Member

@slint slint Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are backend-generated errors that for now don't come from user input, and if/when they do (e.g. for users defining their own checks rules) we'll be sanitizing input.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sanitization is done in Marshmallow in the other pull request inveniosoftware/invenio-checks#30 (field CheckConfigSchema.description).
Since FeedbackLabel expects either a plain text error, or the new error format from the checks, the risk of this widget being misused should be low.

@ptamarit ptamarit merged commit c819679 into inveniosoftware:master Mar 26, 2025
2 checks passed
@ptamarit ptamarit deleted the 1135-links-in-description branch March 26, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

checks: add links to rules so we can link to static pages
3 participants