• rizzothesmall@sh.itjust.works
    link
    fedilink
    arrow-up
    55
    ·
    edit-2
    4 hours ago

    Being able to determine if a username is valid without a valid password is a security flaw

    Even something as simple as taking longer to validate the password when the username is a valid one can also lead to user enumeration

    • theo@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      4 hours ago

      I was having a chat about this with a UX guy. His argument for using a similar flow was that the username/email will have to be validated at the point of registration anyway so you might as well make it easier for the user when the email is wrong. I couldn’t really refute this logic.

      If you throttle both login and registration, then surely the risk is minimised while keeping the user happy?

      • LeapSecond@lemmy.zip
        link
        fedilink
        arrow-up
        10
        ·
        3 hours ago

        You see the registration problem in so many places. If the username is an email, the proper way to validate it without revealing if an account exists is to accept any email address and if it already exists say that in the registration email you would send anyway. With the appropriate throttling if needed.

  • RamenJunkie@midwest.social
    link
    fedilink
    English
    arrow-up
    9
    ·
    4 hours ago

    My bigger beef is when I enter the wrong email and it rolls me over to a sign up screen.

    Fucker, I have an account, I just don’t remeber which of my 20 email addresses it is.

  • Subscript5676@piefed.ca
    link
    fedilink
    English
    arrow-up
    5
    ·
    3 hours ago

    In cass it’s not clear from other comments, if the site tells you either one’s wrong but not both, you can then brute force and try out a bunch of usernames and passwords to effectively farm for both: those that say “wrong username” means that the password is valid, while those that say “wrong password” means you got the username that’s in the system.

    Once you’ve collected them, the rest is just trying out every password for every user.

    So… while this seems weird for a person, it is very much intentional.

    • scutiger@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      2 hours ago

      There’s no way of knowing if a password is valid without the matching username. That doesn’t make any sense.

      • Hack3900@lemy.lol
        link
        fedilink
        arrow-up
        6
        ·
        2 hours ago

        You underestimate my capacity to store passwords in plaintext and iterate over all of them for no good reason

          • TurtleTourParty@midwest.social
            link
            fedilink
            English
            arrow-up
            2
            ·
            39 minutes ago

            Passwordle!

            I thought for a minute that that would be a fun password manager easter egg, but all my passwords are randomly generated so it would be super hard.

    • InputZero@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 hours ago

      Yeah a wrong username means both are wrong. That’s not how it works, that’s not how any of this works.

      • palordrolap@fedia.io
        link
        fedilink
        arrow-up
        4
        ·
        3 hours ago

        *whose

        “who’s” is “who is”[1] or “who has”[2], and it can be wrestled into a possessive if you make “who” all or part of a name[3], but it’s the wrong sort of possessive for this context. If you really want the possessive form, it ought to be phrased “which person’s”, which is mostly what “whose” means.

        (An actual linguist would speak more about the genitive and how it works in English, but I’m not as capable.)

        [1]: e.g. “Who’s there?” [2]: e.g. “Who’s let the cat out again?” [3]: e.g. “This is you-know-who’s box of tricks.”

        • kryptonianCodeMonkey@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          3 hours ago

          Well, that was an entirely unnecessary and lengthy correction to a mistake that was A) a typo I didn’t notice from using swipe on my phone keyboard, not a misunderstanding on grammar, and B) not an error that rendered my comment confusing or indecipherable requiring your clarification. But thank you for your (air quotes) help. I really hope that you’re a bot, not a person this annoying or one who writes that way.

          • palordrolap@fedia.io
            link
            fedilink
            arrow-up
            1
            ·
            1 hour ago

            I’m about 50/50 on grammar errors. They bother me either way, but sometimes I feel the need to correct them and try to explain why.

            Today I seem to have worded it in a way that’s rubbed people the wrong way. It has gone better. You win some, you lose some.

            And yes I know I sound like an LLM. I used to not be able to communicate my ideas at all (flashback to not being able to string a 500 word essay together at school) but then I got a job working technical support and I had to figure out a way of getting my ideas and explanations across. And this is now how I communicate, for better or worse.

            Unfortunately, LLMs learned how to communicate in a not dissimilar way. And so we sound alike.

      • bleistift2@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        13
        ·
        edit-2
        5 hours ago

        I don’t know who is password, or why is password, or when is password, but I do know where is password, and it’s out there!

  • waigl@lemmy.world
    link
    fedilink
    arrow-up
    55
    ·
    7 hours ago

    Any further “helpful” information in that error message would be a security issue.

    • smeg@feddit.uk
      link
      fedilink
      English
      arrow-up
      18
      ·
      7 hours ago

      I am annoyed by (but respect) APIs that take it a level further and don’t even give you a 403 to say you’re unauthorised, they just give you a 404 because anything else would acknowledge that the resource you requested actually existed

      • Pika@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        12
        ·
        edit-2
        4 hours ago

        I don’t respect them because most instances a 403 is more than adequate for your security. The only time I agree with having a 404 over a 403 would be file-specific pathing, but realistically the entire file directory should be a 403 instead of a 404, And then if the user is authorized to access the resource(but it isn’t there), then it gives a 404.

      • wheezy@lemmy.ml
        link
        fedilink
        English
        arrow-up
        9
        ·
        5 hours ago

        Wouldn’t unauthorized only be meant for AFTER a login is successful?

        Like, the user should have to have an active session first. Maybe you’re just talking about that case though.

        • smeg@feddit.uk
          link
          fedilink
          English
          arrow-up
          3
          ·
          4 hours ago

          Maybe I meant unauthenticated. What is this, mandatory cybersecurity education!?

  • saltesc@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    edit-2
    6 hours ago

    try all passowrds. Fail

    Maybe I don’t have an account…

    create new account. email already in use. Fail.

    Okay, guess I’ll reset the password through email.

    password can’t be one already used. Fail

    WHAT?!

    • Pika@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      5
      ·
      4 hours ago

      Not gonna lie back when websites had password hints that you could do. I used to put something like that where it wouldn’t be the full password, but it would be either a part of the password or I would label it as same as computer password or something like that.

      God, I was so insecure when I was young.

  • TheFogan@programming.dev
    link
    fedilink
    English
    arrow-up
    13
    ·
    7 hours ago

    yeah real question how would the website even know. Whole point is to match the 2 things together. Is hunter2 my password, well that depends who are you, we’ve got plenty of users that have that hunter2 password

    • GamingChairModel@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      5 hours ago

      The website could know whether the username actually exists on the system. But revealing that information is a security weakness because someone could at least learn who has an account at that site (especially if usernames are email addresses, as they often are).

      • TheFogan@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 hours ago

        Right but not only is it a security weakness, but it’s also not helpful to the user. Point is the username probably exists in the system.

        Say I went to a website to register TheFogan, but TheFogan already exists, so I created TheFogan2.

        3 years later I go back to the website, try and log in with username: “TheFogan” password: “Hunter2”, and it tells me “your username is right but your password is wrong”. But in reality I have the right password for my account, but the site would just think I have the wrong password for the guy who beat me to my account.

        So yeah agreed the primary reason for it is security, IE a fully user focused, while having bad security practices would be, a "if the username exists in the system, report “Username and password don’t match”, if the username doesn’t exist report “There is no user by this name in the system”. My point is the site only can know if they have a user by that username, not whether that is MY username.

    • TheYojimbo@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      5 hours ago

      Not exactly. It should check for the username and password separately. First check if the user exists, then check if the salted passwords match.

      • Pika@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        4 hours ago

        Generally speaking, unless you’re using OAuth for an authentication, you would check your username and your password at the same time. It’s just you wouldn’t respond if either existed or not. You would just say invalid username and password combination.

        What gets really complicated is the hybrid SSO integrations where they use a username and then if the account has SSO enabled it then redirects you to the sign-in page, Otherwise, it brings you to a password field.

        Realistically what these sites should do to prevent that vulnerability would be to make it so you have to click a dedicated sign in with single sign on button. But not everyone does that type of flow.

        Granted, this also doesn’t include sites that convert your user account into a user ID. And then for your password’s table, only give a user ID. Those would require two queries or a join, regardless, because it’s two separate data places. One to get the user Id and one to get the passwords

  • zxqwas@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    6 hours ago

    If they told you the user name is wrong you may as well publish a list of usernames of your site.

  • chattre@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    5
    ·
    7 hours ago

    “Something went wrong.”

    motherfucker I will OPEN UP THE NETWORK INSPECT TAB AND FIGURE OUT WHAT WENT WRONG.

        • 123@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          4 hours ago

          Had manager that wanted us to return error codes on a field of an API response along with an HTTP 200 because “errors bad”. It needed a few of us to make him understand how that worked against common design patterns and you still had to handle error codes since you didn’t know if the error would be coming from the app, web server, api gateway, local network (no internet), etc.