-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix #3896, If I know your session's objectId, I can delete it without any auth #3925
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
fix #3896, If I know your session's objectId, I can delete it without any auth #3925
Conversation
…if you know objectId
I'm new here, so how can I debug if the test fail with Postgres? 🤔 |
@dplewis Thanks! I'll try that. |
@pungme no problem, I ran your test against postgres and an error was thrown
For
There might be a better way to do it but your test passed when I added this here https://github.com/parse-community/parse-server/blob/master/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js#L187
|
@dplewis thanks a lot man, I'll work on it! |
It should probably never reach the database adapter, most likely should be handled in the DatabaseController |
@pungme If you have time can you write a test for update session throws @flovilmart The test for update session doesn't have a rest key so it throws an unauthorized error. |
Hey, @dplewis sure man, I can add that. @flovilmart do you mean i should move my checking (currently in middleware.js) to the DatabaseController ? Cheers |
Codecov Report
@@ Coverage Diff @@
## master #3925 +/- ##
==========================================
+ Coverage 90.43% 90.45% +0.01%
==========================================
Files 114 114
Lines 7682 7686 +4
==========================================
+ Hits 6947 6952 +5
+ Misses 735 734 -1
Continue to review full report at Codecov.
|
@pungme the fix should probably be in rest.js, let me see if I can do something about it :) |
@flovilmart just adjusted it maybe something like this? |
@flovilmart oh just saw that you have another pull request, yes that's much better! Thanks! |
No problem thanks for reporting and adding the failing tests, that was 👍 ! I'll close that one if you don't mind and use the other one. |
@flovilmart not at all! go ahead :-) |
Thanks for the quick fix! |
X-Parse-Session-Token: 'something'
through the header it'll check and throw an error. but if not passingX-Parse-Session-Token:
at all, it'll bypass the session check and rely on ACL instead. Which is fine for other classes but for_Session
is a crucial exploit since it'sPublic Read & Write
.middleware.js
, we tried to check the session inrest.js
but it seems to break other test.