authentik icon indicating copy to clipboard operation
authentik copied to clipboard

If a user accidently puts the password in as their username the password will be logged

Open boreq opened this issue 8 months ago • 5 comments

Describe the bug

I just accidentally pasted my password as my username and hit enter when logging in before realising what happened. Authentik logged the password which is now present in plain text in the logs. I suspect that's expected behaviour but it sounds like that would be a very easy way of leaking passwords since something like that happens all the time. This happens for many events not just the one I provided.

How to reproduce

  1. Try to log in and put anything as the username.
  2. The string is logged.

Expected behavior

Unclear.

Screenshots

No response

Additional context

No response

Deployment Method

Docker

Version

2025.8.1

Relevant log output

{"amount": -1, "auth_via": "unauthenticated", "domain_url": "example.com", "event": "Updated score", "for_ip": "1.2.3.4", "for_user": "my_password_is_here", "host": "example.com", "level": "info", "logger": "authentik.policies.reputation.signals", "pid": 1351414, "request_id": "1234", "schema_name": "public", "timestamp": "2026-03-25T12:04:47.789586"}

boreq avatar Mar 25 '26 12:03 boreq

In general I think the usefulness of logging when a login for an account that doesn't exist fails is questionable from my perspective. It would be useful to know if someone is trying to access removed accounts but other than that the only useful info would MAYBE be that someone is trying to log in to an account that doesn't exist (as in any account so no need to track the username) e.g. there is an attack - but that's just literally all the time every day so this info also has no value from my perspective.

And any of those signals should be handled by the automated heuristics or policies, not detected by looking at the logs so logging them again is imo not actually useful.

boreq avatar Mar 25 '26 12:03 boreq

I'd say the username for unsuccessful attempts (as in, user unknown) should be logged at DEBUG level and not on INFO. So when you go to production with real users and their leaky real password, they won't get logged.

headlesssetup avatar Mar 25 '26 17:03 headlesssetup

The issue with any attempt to fix this is that sure the value is currently logged as is; however even if it weren't logged it'd be recorded in the Reputation table, and depending on policies it might be logged in other places, or logged as an event.

BeryJu avatar Mar 27 '26 13:03 BeryJu

I mean from my side this isn't a problem per se as:

  • I changed my password
  • my password is auto generated so even if it leaks it doesn't reveal any private info but I bet that's not the case for other people
  • I run my own instance
  • I don't push the logs anywhere

However:

  • presumably other people accidentally do this as well
  • then whoever runs the instance may be looking at their password even though didn't mean to and tons of people have private info in passwords
  • it may get sent to other people accidentally when debugging things
  • it may be being pushed somewhere as logs are collected
  • the password should in general right away be considered compromised in this scenario
  • nobody will ever detect that this has happened ever let's face it

So I can close this issue from my side if you want but I'd see some security implications here.

boreq avatar Mar 27 '26 13:03 boreq

We're not going to implement a change for this. The solution in cases like this would be to update your password.

dewi-tik avatar Apr 02 '26 16:04 dewi-tik