cross-posted from: https://lemmy.ml/post/12744832

As I updated the version to 1.4.0 , adding the ‘import’ feature I am sharing this here.

I made this extension because I couldn’t find one that wouldn’t ask for too much permissions (such as accessing all websites data).

Eventually I found it nice to have a TOTP that can really be audited, the code is 649 lines of JS, 214 CSS and 52 HTML. Feel free to fork, copy part of it, contribute or just request fix/features.

I have used it for more than a year every day and it works nicely.

  • AYO_Official@lemmy.mlOP
    link
    fedilink
    arrow-up
    16
    ·
    9 months ago

    Well this is 600 lines of code, if you cannot audit that you can indeed ignore it for now. Once again this is the only auditable code out there and not asking for unrelated permissions.

    • miss_brainfarts
      link
      fedilink
      arrow-up
      8
      ·
      9 months ago

      It might be safe, it might work well and all, but it does defeat the point of 2FA, so I wouldn’t want people to even know about it before they explored undeniably better and safer options, like Authenticator apps for their phones.

      But to be fair, many people around the world only have one single device, so 2FA becomes a difficulty. But that’s the point where I’m not knowledgable enough anymore to see what the best way of going about it is.

      From my gut feeling, I’d rather put a dedicated TOTP App on a device than to use a browser extension.

      • AYO_Official@lemmy.mlOP
        link
        fedilink
        arrow-up
        9
        ·
        edit-2
        9 months ago

        Thank you for your constructive comment.

        Indeed many people thinks 2FA as 2 devices. I am not sure where that came from and what specifically make people think that way. Despite all my research and experience using 2 devices solve no specific security problem. I think there is a whole topic to be argued on this (should I make a blog post on this?).

        As for me I have Aegis on my smartphone (really perfect nothing to say). But I have many unwanted/unnecessary 2FA to go through every day (for the last 3 years). I am cleaning my cookie/connection every time I close my web browser and I am not keeping my computer on all the time. Therefore those 2FA needs to be done a lot (I mean at least 3 time a day). I do not interact much with my smartphone, also this is the least secure device I own so web browser extension is an OK way. I used to have a python script I could have run from one of my IoT through ssh. So far I don’t see any vector of attack this would prevent compared to browser extension.

        I see hundreds of thousands of users using other extensions that I wouldn’t run on my system and I am sharing a better solution, nothing perfect, nothing that requires mass adoption.

        • miss_brainfarts
          link
          fedilink
          arrow-up
          7
          ·
          9 months ago

          2FA being on a separate device is simply the most secure way of doing it. An attacker who gets access to some passwords for my accounts can’t do a whole lot without also physically stealing my phone.

          It’s simply an extra hurdle for malicious actors to go through.

          Though I guess in most cases, having any 2FA at all will probably already turn off a majority of attackers.

        • Pantherina@feddit.de
          link
          fedilink
          arrow-up
          2
          ·
          9 months ago

          Thanks a lot! I selectively keep cookies for login sites, which is not a good solution.

          The threat is websites escaping the browser sandbox and reading stuff. I dont know if this is really that realistic though.

          • AYO_Official@lemmy.mlOP
            link
            fedilink
            arrow-up
            2
            ·
            9 months ago

            Websites have no way to creep into your browser, extensions included. Usually it is the other way around. Such a leak would be catastrophic for the browser (thinks of all the password manager). At least here it is not even a password manager but only the TOTP so you still have your password as security (still this will never happen realistically).

    • CameronDev@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      9 months ago

      With all due respect, it doesnt matter what the code is right now. This is an extension that you can update at any point in the future to replace with something malicious.

      Trust is near impossible to build in todays internet.

      https://www.kaspersky.com.au/blog/dangerous-chrome-extensions-87-million/32170/

      Note that a plugin’s malicious functionality can evolve over time in line with its owners’ goals. And the owners themselves may change: there have been cases when malicious features appeared in a previously safe extension after its creators sold the plugin to someone else.

      • AYO_Official@lemmy.mlOP
        link
        fedilink
        arrow-up
        4
        ·
        9 months ago

        This is were the manifest/permission is important. I cannot emphasize enough that I had to code this myself because, at the time, nothing else would be OK with me. This was because of 1- way too big of a code base, 2- way too many permissions.

        It is indeed a problem that extensions are not as well maintained as Linux distribution packages but in this specific instance the extension has no right to read any information nor send requests to any server.

        • CameronDev@programming.dev
          link
          fedilink
          arrow-up
          4
          ·
          9 months ago

          I appreciate you have put effort into this, and you have gone out of your way to make it safer, but if the extension were to become malicious at a later date, expanding permissions (and relying on users brainlessly-clicking accept) or using an exploit or sidechannel would undo any of that.

          The downside of browser extensions is that they are operating within a massive codebase, and thus have a huge attack surface if they decide to become malicious.

          For what its worth, I commend your efforts here, its just near impossible to trust any peice of software not backed by the reputation of an established company/developer.