Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Core: Added escapeHtml option to avoid XSS attacks via showLabel method#2462

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

volkanceylan
Copy link
Contributor

This adds a new constructor option "escapeHtml".

There is a script injection risk if the messages set via $.validator.messages etc. are originating from a user localizable dictionary, like a translation screen as the showLabel function uses .html() to set the label content. Even in cases where that is not an issue, if the message itself contains a format placeholder like "{0} is not valid value for this field", as the value passed to {0} is a user input, it still provides an opportunity for script injection attacks albeit at a lower risk.

@volkanceylanvolkanceylan changed the titleCore: Added escapeHtml option to avoid XSS attacks via showLabel methodsCore: Added escapeHtml option to avoid XSS attacks via showLabel methodJan 25, 2023
@bytestreambytestream linked an issueFeb 1, 2023 that may beclosed by this pull request
@bytestreambytestream merged commit7a490d8 intojquery-validation:masterFeb 1, 2023
@bytestream
Copy link
Member

Thanks@volkanceylan

@bholmesACR
Copy link

@volkanceylan Hey there, did this fix get added to a new release? According to Sonatype vulnerability listing "sonatype-2023-0681", which links to this page, the vulnerability has not been addressed in a new release since the current one version 1.19.5 is still affected correct?

@volkanceylan
Copy link
ContributorAuthor

I don't think they released it yet, and it is not on by default so just updating won't resolve the issue.

@bytestream
Copy link
Member

@bholmesACR see1.20.0

@bholmesACR
Copy link

@bytestream Thanks! Also do we have to turn on/enable something like@volkanceylan says even after updating to remediate the risk? Just want to confirm

@bytestream
Copy link
Member

@bholmesACR You have to setescapeHtml: true, in your jquery-validation config

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add option to html escape the messages in showLabel function
3 participants
@volkanceylan@bytestream@bholmesACR

[8]ページ先頭

©2009-2025 Movatter.jp