Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

500 responses send Prisma's error text to the client

オープン
#971 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
backend, security

調査の方向性

Start by reading ErrorHandler and the PrismaClientKnownRequestError branch, then inspect StudiesController.ts for plain Errors whose messages are intended for users. Update the handling so client responses do not expose error details while user-facing messages use UnprocessableError; log errors server-side. Done means the described 500 responses no longer expose query data or internal error text.

索引モデルが issue の本文から書いたものです。

説明

backend bug

ErrorHandler ends with a catch-all that returns { message: 'Internal Server Error', details: err.message } for any error it doesn't recognise, so Prisma's own error text goes to the client. #880 sanitised the 422 ValidateError branch for #879, but not this one.

For example, PATCH /profiles/current with a key the request type allows but the profile table doesn't have, such as password, returns a 500 whose details is Prisma's dump of the query: the values sent, including the password, and every column the model accepts. logger.error writes the same text to the logs. The PrismaClientKnownRequestError branch returns err.meta as details for every code, and err.message for codes other than P2002 and P2025.

Fix: return a fixed message with no details from both branches, and log the error on the server instead. First turn the plain Errors that carry a message meant for users into UnprocessableError, such as "Study with that name already exists" in StudiesController.ts, because the admin portal shows that text from the 500's details today.

Related: #879, #880, #418, #919, #943.

主要言語
TypeScript
スター
4
フォーク
0
平均マージ
14時間 50分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Garvan-Data-Science-Platform/ctrl のほかの issue

Garvan-Data-Science-Platform/ctrl の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。