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

safely escape <script> injected code #3101

Merged
merged 3 commits into from
Aug 19, 2021
Merged

safely escape <script> injected code #3101

merged 3 commits into from
Aug 19, 2021

Conversation

mifi
Copy link
Contributor

@mifi mifi commented Aug 13, 2021

fixes #2974

Copy link
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up

@@ -1,4 +1,6 @@
const { URL } = require('url')
const serialize = require('serialize-javascript')

const tokenService = require('../helpers/jwt')
const { hasMatch, sanitizeHtml } = require('../helpers/utils')
Copy link
Member

Choose a reason for hiding this comment

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

Is sanitizeHtml still used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right! good catch. I'll remove the whole function. eslint would have caught unused sanitizeHtml but we only use warning for most rules 😄 we need to eventually go through all warnings and fix them so we can upgrade more eslint rules to error. now it's just too many warning so I tend to ignore them all

Copy link
Contributor

Choose a reason for hiding this comment

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

#3095 ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome!!

@Murderlon Murderlon merged commit 3059d73 into main Aug 19, 2021
@Murderlon Murderlon deleted the fix-script-escape branch August 19, 2021 16:27
Murderlon added a commit that referenced this pull request Aug 25, 2021
* main: (23 commits)
  Release
  Set node version in `workflows/cdn.yml` to 16.x
  Release
  build: add stylelint (#3124)
  Core: rename allowMultipleUploads to allowMultipleUploadBatches (#3115)
  meta: enforce `no-unused-vars` linter rule (#3118)
  writing-plugins: update example to use `i18nInit` (#3122)
  @uppy/core: reject empty string as valid value for required meta fields (#3119)
  Safely escape <script> injected code in companion `send-token.js` (#3101)
  @uppy/dashboard: fix metafield form validation (#3113)
  Clean up `BACKLOG.md` & add Vimeo as todo
  Add referrer to transloadit.com link (#3116)
  @uppy/locales latest version is 1.22.0 🙈
  Stricter linter (#3095)
  @uppy/aws-s3: refactor to use private fields (#3094)
  build: fix legacy bundle (#3112)
  Fix locales — point to CDN v1.31.0
  Fix typo in `docs/companion.md`
  Changelog for 1.31.0 and patches
  Strictly type uppy events (#3085)
  ...
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.

security: js injection
3 participants