ory / ory/kratos

Frontend Get User-Flow Errors API exposes technical details

Open
#4,100 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
13.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
Ory Network Project

No response

Describe the bug

When there are errors during the login flow, e.g. connectivity isseus to the database, error response might contain technical details such as IP addresses. It is frontend API hence all details visible/accisible to the user.

Reproducing the bug

Easiest way to reproduce is stopping database after flow is started and choose authentication provider.

{
"error": {
"code": 500,
"status": "Internal Server Error",
"message": "FATAL: terminating connection due to administrator command (SQLSTATE 57P01)"
}
}

If there are issues in connecting to openid provider it might as well return IP addresses e.g.

{
"id": "86699ea5-8293-4f3f-80e3-f71265444714",
"error": {
"code": 500,
"status": "Internal Server Error",
"message": "unable to fetch records: write failed: write tcp 127.0.0.1:50556->127.0.0.1:5432: write: broken pipe"
},
"created_at": "2024-09-06T09:09:39.895651Z",
"updated_at": "2024-09-06T09:09:39.895651Z"
}
Relevant log output

No response

Relevant configuration

No response

Version

v1.2.0

On which operating system are you observing this issue?

Windows

In which environment are you deploying?

Docker Compose

Additional Context

No response

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 frontend API error response shown in the report, then reproduce the issue by stopping the database during a login flow and selecting an authentication provider. Trace how the SQL and OpenID connection errors become the returned message; done means technical details such as SQLSTATE values and IP addresses are no longer exposed to the user.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.