-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
Full resolver source is leaked in error message when no subscription topics are provided #489
Comments
@MichalLytek I didn't realize until after I submitted topics can be passed in user args - please take a look at this ASAP |
@MichalLytek 911 🚨 Sorry to nag but this is a big deal and needs to be patched immediately |
The big deal is that you don't filter the errors returned to the client. This way you can also return failed SQL query or a full stacktrace from internal server error. The
Always validate and sanitize your inputs, don't trust users. So you should check the arg and accept only a set of values for topics, as well as check the length, don't just pass the input as topic to subscription. And I think that reporting it to npm won't help and won't speed up things. If you need a quick fix, checkout |
Right, I get that. The reason I say it's a big deal has more to do with the fact that I opened a public github issue for what ended up being a potentially devastating exploit (sorry!). But if you're not worried about it 🤷♂ Great project btw, thanks for all of your work on this! I will update my PR to address your comments. |
Fixed via 26ee0ce, released as |
Describe the bug
Full resolver source is leaked in error message when no subscription topics are provided. This appears to be caused by this line and should be easy to fix with either a
toString
method or changing thetarget
reference totarget.name
.type-graphql/src/errors/MissingSubscriptionTopicsError.ts
Line 3 in 445ae0a
To Reproduce
Given the resolver:
Attempting to subscribe to
watchSomething
with:Returns the following:
Expected behavior
Only the name of the resolver should be logged
Logs
N/A
Enviorment (please complete the following information):
[email protected]
[email protected]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: