Remove vulnerability xss hack#3030
Merged
briri merged 24 commits intoDMPRoadmap:developmentfrom Sep 27, 2021
Merged
Conversation
briri
requested changes
Sep 21, 2021
Contributor
briri
left a comment
There was a problem hiding this comment.
Thanks for tackling this one @martaribeiro.
I think it would good to move this into the base application_record.rb file that all of the models inherit from. Something like:
class ApplicationRecord < ActiveRecord::Base
# other existing methods
def sanitize_fields(*attrs)
attrs.each do |attr|
self.send("#{attr.to_s}=", ActionController::Base.helpers.sanitize(self.send(attr)))
end
endThen, in the models you can do something like:
before_save sanitize_fields(:title, :funder_name, :grant_number, :identifier, :description)
change "lambda" to "->(data) {" instead
change "lambda" to "->(data) {" instead
briri
approved these changes
Sep 27, 2021
Contributor
|
was out of sync with development so rebased via GitHub |
This was referenced Sep 29, 2021
portagenetwork
pushed a commit
to portagenetwork/roadmap
that referenced
this pull request
Feb 24, 2022
…vulnerability_XSS_hack Remove vulnerability xss hack
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.
Fixes # https://github.com/DigitalCurationCentre/DMPonline-Service/issues/603.
Changes proposed in this PR:
Callback was added to user and plan models. 'before_save' was added with a function sanitise a number of field before data was saved into the db