Skip to content

fix: Queries fail on nested date attributes #7582

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

Draft
wants to merge 63 commits into
base: alpha
Choose a base branch
from

Conversation

hariprasadiit
Copy link

@hariprasadiit hariprasadiit commented Sep 19, 2021

New Pull Request Checklist

Issue Description

Queries return empty results if nested date attributes are used in constraints

Related issue: #7575

Approach

MongoDB transformer was implemented to only transform root level attributes and leave nested attributes as it is except Date and Bytes. There was inconsistency between transformQueryKeyValue and parseObjectToMongoObjectForCreate which was causing some nested date queries to fail. following changes are made to fix it.

  1. Don't transform nested Date types
  2. Don't transform query constraints, where key is a path, like rootProp.nestedProp .

TODOs before merging

  • Add test cases
  • Add entry to changelog

@parse-github-assistant
Copy link

parse-github-assistant bot commented Sep 19, 2021

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (679c61d) 94.13% compared to head (572dabf) 84.86%.
Report is 289 commits behind head on alpha.

❗ Current head 572dabf differs from pull request most recent head 433de1a. Consider uploading reports for the commit 433de1a to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #7582      +/-   ##
==========================================
- Coverage   94.13%   84.86%   -9.28%     
==========================================
  Files         182      183       +1     
  Lines       13785    13624     -161     
==========================================
- Hits        12977    11562    -1415     
- Misses        808     2062    +1254     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hariprasadiit hariprasadiit requested a review from mtrezza October 1, 2021 03:33
@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title fix: Queries fail on nested date attributes fix: queries fail on nested date attributes Oct 9, 2021
@mtrezza
Copy link
Member

mtrezza commented Oct 9, 2021

Could you look at the failing postgres tests? I seems the postgres adapter needs some changes too? And could you delete the TODOs at the top that don't apply here?

@hariprasadiit
Copy link
Author

I'm not very familiar with PostgreSQL. I'll take a dig at it and see if I can figure it out.

@mtrezza
Copy link
Member

mtrezza commented Oct 15, 2021

Do you need a hand with Postgres?

@hariprasadiit
Copy link
Author

Sorry for the delay. I'm busy with some company work now. I'll take a look as soon as I can

yog27ray and others added 30 commits March 22, 2023 21:22
## [5.4.3](parse-community/parse-server@5.4.2...5.4.3) (2023-03-22)

### Bug Fixes

* Unable to create new role if `beforeSave` hook exists ([parse-community#8474](parse-community#8474)) ([4f0f0ec](parse-community@4f0f0ec))
…rict file upload by file extension; this fixes a security vulnerability in which a phishing attack could be performed using an uploaded HTML file; by default the new option only allows file extensions matching the regex pattern `^[^hH][^tT][^mM][^lL]?$`, which excludes HTML files; this fix is released as a patch version given the severity of this vulnerability, however, if your app currently depends on uploading files with HTML file extensions then this may be a breaking change and you could allow HTML file upload by setting the option to `['.*']` (parse-community#8537)
# [5.5.0](parse-community/parse-server@5.4.3...5.5.0) (2023-05-20)

### Features

* Add new Parse Server option `fileUpload.fileExtensions` to restrict file upload by file extension; this fixes a security vulnerability in which a phishing attack could be performed using an uploaded HTML file; by default the new option only allows file extensions matching the regex pattern `^[^hH][^tT][^mM][^lL]?$`, which excludes HTML files; this fix is released as a patch version given the severity of this vulnerability, however, if your app currently depends on uploading files with HTML file extensions then this may be a breaking change and you could allow HTML file upload by setting the option to `['.*']` ([parse-community#8537](parse-community#8537)) ([196e05f](parse-community@196e05f))
## [5.5.1](parse-community/parse-server@5.5.0...5.5.1) (2023-05-23)

### Bug Fixes

* Security upgrade @parse/push-adapter from 4.1.2 to 4.1.3 ([parse-community#8571](parse-community#8571)) ([8e83cac](parse-community@8e83cac))
## [5.5.2](parse-community/parse-server@5.5.1...5.5.2) (2023-06-28)

### Bug Fixes

* Remote code execution via MongoDB BSON parser through prototype pollution; fixes security vulnerability [GHSA-462x-c3jw-7vr6](GHSA-462x-c3jw-7vr6) ([parse-community#8675](parse-community#8675)) ([5fad292](parse-community@5fad292))
## [5.5.3](parse-community/parse-server@5.5.2...5.5.3) (2023-06-29)

### Bug Fixes

* Server does not start via CLI when `auth` option is set ([parse-community#8669](parse-community#8669)) ([601da1e](parse-community@601da1e))
## [5.5.4](parse-community/parse-server@5.5.3...5.5.4) (2023-07-30)

### Bug Fixes

* Security upgrade semver from 7.5.1 to 7.5.2 ([parse-community#8704](parse-community#8704)) ([c7fa3b9](parse-community@c7fa3b9))
… circumvent `beforeFind` query trigger; fixes security vulnerability [GHSA-fcv6-fg5r-jm9q](GHSA-fcv6-fg5r-jm9q)
## [5.5.5](parse-community/parse-server@5.5.4...5.5.5) (2023-09-04)

### Bug Fixes

* Parse Pointer allows to access internal Parse Server classes and circumvent `beforeFind` query trigger; fixes security vulnerability [GHSA-fcv6-fg5r-jm9q](GHSA-fcv6-fg5r-jm9q) ([6458ab0](parse-community@6458ab0))
## [5.5.6](parse-community/parse-server@5.5.5...5.5.6) (2023-10-20)

### Bug Fixes

* Server crash when uploading file without extension; fixes security vulnerability [GHSA-792q-q67h-w579](GHSA-792q-q67h-w579) ([parse-community#8782](parse-community#8782)) ([686a9f2](parse-community@686a9f2))
# [5.6.0](parse-community/parse-server@5.5.6...5.6.0) (2023-10-25)

### Features

* Add `$setOnInsert` operator to `Parse.Server.database.update` ([parse-community#8790](parse-community#8790)) ([c4a4a2a](parse-community@c4a4a2a))
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.

8 participants