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

refactor: use common path extraction for mysql/mariadb/sqlite #11329

Merged
merged 2 commits into from Aug 18, 2019

Conversation

sushantdhiman
Copy link
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

This fixes a security issue with sequelize.json(), some old code was still used for formatting sub paths for json queries when used with sequelize.json() function helper

Example of attack vector

return User.findAll({
  where: this.sequelize.json("data.id')) AS DECIMAL) = 1 DELETE YOLO INJECTIONS; -- ", 1)
});

@codecov
Copy link

codecov bot commented Aug 18, 2019

Codecov Report

Merging #11329 into master will decrease coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11329      +/-   ##
==========================================
- Coverage   96.32%   96.25%   -0.07%     
==========================================
  Files          94       94              
  Lines        9160     9101      -59     
==========================================
- Hits         8823     8760      -63     
- Misses        337      341       +4
Impacted Files Coverage Δ
lib/dialects/mariadb/query-generator.js 100% <ø> (+2.12%) ⬆️
lib/dialects/sqlite/query-generator.js 96.11% <100%> (-0.24%) ⬇️
lib/dialects/abstract/query-generator.js 97.6% <100%> (ø) ⬆️
lib/dialects/mysql/query-generator.js 97.79% <100%> (-0.09%) ⬇️
lib/dialects/postgres/connection-manager.js 92.25% <0%> (-3.53%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83e263b...d5eac27. Read the comment docs.

@sushantdhiman sushantdhiman merged commit 9bd0bc1 into master Aug 18, 2019
@sushantdhiman sushantdhiman deleted the mysql-json branch August 18, 2019 12:02
@sushantdhiman
Copy link
Contributor Author

🎉 This PR is included in version 5.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant