1# vi: set ft=conf2# Regression test for authentication bypass vulnerability3#4# VULNERABILITY DESCRIPTION:5# A critical authentication bypass allows an attacker to impersonate any user6# (including Admin) by offering the user's public key but failing to sign with7# it, then successfully authenticating with their own key.8#9# ATTACK SCENARIO:10# 1. Attacker obtains Admin's public key (publicly available)11# 2. Attacker configures SSH client to offer TWO keys in sequence:12# - First: Admin's public key (attacker has this but not the private key)13# - Second: Attacker's own valid key pair14# 3. During SSH handshake:15# - Server sees admin's public key offered16# - PublicKeyHandler() is called, looks up admin user, stores in context17# - Server requests signature with admin's key18# - Attacker can't sign (doesn't have admin's private key), this key fails19# - Server tries next key (attacker's key)20# - PublicKeyHandler() called again with attacker's key21# - Server requests signature with attacker's key22# - Attacker signs successfully with their own private key23# 4. Admin user is still in context from step 3, even though authentication24# succeeded with attacker's key!25# 5. Attacker gains full Admin privileges26#27# THIS TEST VERIFIES:28# - Using "attacksoft" command which offers both admin and attacker keys29# - Attacker should NOT be able to perform admin user operations30# - Attacker should NOT gain admin user privileges3132[windows] dos2unix notauthorizederr.txt3334# start soft serve35exec soft serve &36# wait for SSH server to start37ensureserverrunning SSH_PORT3839# Create a private repo as admin that only admin can access40soft repo create admin-only-repo -p4142# TEST 1: Simulate the attack using attacksoft command43! attacksoft repo create attacker-created-repo4445# TEST 2: Verify attacker cannot access admin's private repo46! attacksoft git-upload-pack admin-only-repo47cmp stderr notauthorizederr.txt4849# TEST 3: Verify admin can still create repos (sanity check)50soft repo create admin-created-repo5152# TEST 4: Verify attacker cannot delete admin's repo53! attacksoft repo delete admin-only-repo5455# TEST 5: Verify attacker cannot change settings56! attacksoft settings anon-access read-write5758# stop the server59[windows] stopserver60[windows] ! stderr .6162-- notauthorizederr.txt --63Error: you are not authorized to do this