parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Remove detailed error from error messages

Open mtrezza opened this issue 1 year ago • 8 comments

New Feature / Enhancement Checklist

Current Limitation

For some requests, Parse Server returns more information than necessary in the error response. For example:

unauthorized: master key is required

This is providing an outside attacker with more info than necessary.

Feature / Enhancement Description

Especially when it comes to access / permission errors, I suggest to make the error messages more ambiguous by generalizing them and removing any specific information. Instead of explaining why a request was unauthorized, the error should be only unauthorized without any further details. The detailed error message should only be logged server side.

The task would be:

  • identify error messages that should be generalized
  • ensure a detailed error message is logged server side

This should not be a breaking change, as long as the error code does not change. Changes of error messages are not considered breaking as logic that relies on parsing error messages is considered bad practice anyway.

mtrezza avatar Feb 27 '24 13:02 mtrezza

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza is the issue still open ?

JiteshSinghShekhawat avatar Aug 02 '24 12:08 JiteshSinghShekhawat

Yes

mtrezza avatar Aug 02 '24 22:08 mtrezza

can you assign this issue to me ? @mtrezza

JiteshSinghShekhawat avatar Aug 03 '24 01:08 JiteshSinghShekhawat

Please feel free to pick this up and post a comment for others to be aware that it's in the works.

mtrezza avatar Aug 03 '24 14:08 mtrezza

I'm picking up this issue and will be working on it.

JiteshSinghShekhawat avatar Aug 04 '24 00:08 JiteshSinghShekhawat

@mtrezza basically i have to do this in /src/Adapters/Auth or there any other folder also ?

JiteshSinghShekhawat avatar Aug 04 '24 16:08 JiteshSinghShekhawat

This relates to any response message across Parse Server where more information than necessary is returned. I suggest to do this with just 1 or a few messages, then open a PR for feedback, so you don't make a lot of changes and then have to modify them again.

mtrezza avatar Aug 05 '24 08:08 mtrezza