ChilliCream / ChilliCream/graphql-platform

Don't return server-oriented, implementation-leaking error messages for client errors

Open
#7,133 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate Area: Security Next
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Product

Hot Chocolate

Is your feature request related to a problem?

Consider for example this error:

https://github.com/ChilliCream/graphql-platform/blob/7d21adab765fffad291f22255db1102fed39234e/src/HotChocolate/Core/src/Execution/Properties/Resources.resx#L202

Any client can trivially produce this error by e.g. supplying an invalid value for a GUID field, which results in this message:

"Unable to convert the value of the argument id to System.Guid. Check if the requested type is correct or register a custom type converter."

There are two problems with this:

  • The message, with its mention of registering custom type converters, is oriented toward the server's developers, not clients
  • The message, in printing the fully qualified type name, leaks implementation details. With custom types here, an attacker could get some information about the structure of the codebase, possibly making inferences allowing them to more effectively hack the system.
The solution you'd like

Messages that are oriented toward API clients and which do not leak implementation details.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the conversion error resource linked in src/HotChocolate/Core/src/Execution/Properties/Resources.resx, around line 202, and trace where it is used for invalid GUID arguments. Review the related client-visible error handling and define the wording so it is client-oriented without exposing fully qualified implementation types or server customization guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.