Skip to content

Commit c617288

Browse files
authored
Remove CVE-2024-28080 details from documentation
Removed detailed explanation of CVE-2024-28080, including summary, root cause, exploitation steps, impact, detection ideas, and mitigations.
1 parent 4e53ab0 commit c617288

1 file changed

Lines changed: 0 additions & 110 deletions

File tree

src/pentesting-ci-cd/gitblit-security/gitblit-embedded-ssh-auth-bypass-cve-2024-28080.md

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -106,116 +106,6 @@ Related protocol/design notes and literature:
106106
- [Apache MINA SSHD project](https://mina.apache.org/sshd-project/)
107107
- [PublickeyAuthenticator API](https://svn.apache.org/repos/infra/websites/production/mina/content/sshd-project/apidocs/org/apache/sshd/server/auth/pubkey/PublickeyAuthenticator.html)
108108
- [RFC 4252: The Secure Shell (SSH) Authentication Protocol](https://datatracker.ietf.org/doc/html/rfc4252)
109-
# Gitblit Embedded SSH Auth Bypass (CVE-2024-28080)
110-
111-
112-
113-
## Summary
114-
115-
CVE-2024-28080 is an authentication bypass in Gitblit’s embedded SSH service due to incorrect session state handling when integrating with Apache MINA SSHD. If a user account has at least one SSH public key registered, an attacker who knows the username and any of that user’s public keys can authenticate without the private key and without the password.
116-
117-
- Affected: Gitblit < 1.10.0 (observed on 1.9.3)
118-
- Fixed: 1.10.0
119-
- Requirements to exploit:
120-
- Git over SSH enabled on the instance
121-
- Victim account has at least one SSH public key registered in Gitblit
122-
- Attacker knows victim username and one of their public keys (often discoverable, e.g., https://github.com/<username>.keys)
123-
124-
## Root cause (state leaks between SSH methods)
125-
126-
In RFC 4252, public‑key authentication proceeds in two phases: the server first checks whether a provided public key is acceptable for a username, and only after a challenge/response with a signature does it authenticate the user. In MINA SSHD, the PublickeyAuthenticator is invoked twice: on key acceptance (no signature yet) and later after the client returns a signature.
127-
128-
Gitblit’s PublickeyAuthenticator mutated the session context on the first, pre‑signature call by binding the authenticated UserModel to the session and returning true ("key acceptable"). When authentication later fell back to password, the PasswordAuthenticator trusted that mutated session state and short‑circuited, returning true without validating the password. As a result, any password (including empty) was accepted after a prior public‑key "acceptance" for the same user.
129-
130-
High‑level flawed flow:
131-
132-
1) Client offers username + public key (no signature yet)
133-
2) Server recognizes the key as belonging to the user and prematurely attaches user to the session, returns true ("acceptable")
134-
3) Client cannot sign (no private key), so auth falls back to password
135-
4) Password auth sees a user already present in session and unconditionally returns success
136109

137-
## Step‑by‑step exploitation
138-
139-
- Collect a victim’s username and one of their public keys:
140-
- GitHub exposes public keys at https://github.com/<username>.keys
141-
- Public servers often expose authorized_keys
142-
- Configure OpenSSH to present only the public half so signature generation fails, forcing a fallback to password while still triggering the public‑key acceptance path on the server.
143-
144-
Example SSH client config (no private key available):
145-
146-
```sshconfig
147-
# ~/.ssh/config
148-
Host gitblit-target
149-
HostName <host-or-ip>
150-
User <victim-username>
151-
PubkeyAuthentication yes
152-
PreferredAuthentications publickey,password
153-
IdentitiesOnly yes
154-
IdentityFile ~/.ssh/victim.pub # public half only (no private key present)
155-
```
156-
157-
Connect and press Enter at the password prompt (or type any string):
158-
159-
```bash
160-
ssh gitblit-target
161-
# or Git over SSH
162-
GIT_SSH_COMMAND="ssh -F ~/.ssh/config" git ls-remote ssh://<victim-username>@<host>/<repo.git>
163-
```
164-
165-
Authentication succeeds because the earlier public‑key phase mutated the session to an authenticated user, and password auth incorrectly trusts that state.
166-
167-
Note: If ControlMaster multiplexing is enabled in your SSH config, subsequent Git commands may reuse the authenticated connection, increasing impact.
168-
169-
## Impact
170-
171-
- Full impersonation of any Gitblit user with at least one registered SSH public key
172-
- Read/write access to repositories per victim’s permissions (source exfiltration, unauthorized pushes, supply‑chain risks)
173-
- Potential administrative impact if targeting an admin user
174-
- Pure network exploit; no brute force or private key required
175-
176-
## Detection ideas
177-
178-
- Review SSH logs for sequences where a publickey attempt is followed by a successful password authentication with an empty or very short password
179-
- Look for flows: publickey method offering unsupported/mismatched key material followed by immediate password success for the same username
180-
181-
## Mitigations
182-
183-
- Upgrade to Gitblit v1.10.0+
184-
- Until upgraded:
185-
- Disable Git over SSH on Gitblit, or
186-
- Restrict network access to the SSH service, and
187-
- Monitor for suspicious patterns described above
188-
- Rotate affected user credentials if compromise is suspected
189-
190-
## General: abusing SSH auth method state‑leakage (MINA/OpenSSH‑based services)
191-
192-
Pattern: If a server’s public‑key authenticator mutates user/session state during the pre‑signature "key acceptable" phase and other authenticators (e.g., password) trust that state, you can bypass authentication by:
193-
194-
- Presenting a legitimate public key for the target user (no private key)
195-
- Forcing the client to fail signing so the server falls back to password
196-
- Supplying any password while the password authenticator short‑circuits on leaked state
197-
198-
Practical tips:
199-
200-
- Public key harvesting at scale: pull public keys from common sources such as https://github.com/<username>.keys, organizational directories, team pages, leaked authorized_keys
201-
- Forcing signature failure (client‑side): point IdentityFile to only the .pub, set IdentitiesOnly yes, keep PreferredAuthentications to include publickey then password
202-
- MINA SSHD integration pitfalls:
203-
- PublickeyAuthenticator.authenticate(...) must not attach user/session state until the post‑signature verification path confirms the signature
204-
- PasswordAuthenticator.authenticate(...) must not infer success from any state mutated during a prior, incomplete authentication method
205-
206-
Related protocol/design notes and literature:
207-
- SSH userauth protocol: RFC 4252 (publickey method is a two‑stage process)
208-
- Historical discussions on early acceptance oracles and auth races, e.g., CVE‑2016‑20012 disputes around OpenSSH behavior
209-
210-
## References
211-
212-
- [Gitblit CVE-2024-28080: SSH public‑key fallback to password authentication bypass (Silent Signal blog)](https://blog.silentsignal.eu/2025/06/14/gitblit-cve-CVE-2024-28080/)
213-
- [Gitblit v1.10.0 release notes](https://github.com/gitblit-org/gitblit/releases/tag/v1.10.0)
214-
- [Apache MINA SSHD project](https://mina.apache.org/sshd-project/)
215-
- [PublickeyAuthenticator API](https://svn.apache.org/repos/infra/websites/production/mina/content/sshd-project/apidocs/org/apache/sshd/server/auth/pubkey/PublickeyAuthenticator.html)
216-
- [RFC 4252: The Secure Shell (SSH) Authentication Protocol](https://datatracker.ietf.org/doc/html/rfc4252)
217-
- [CVE‑2016‑20012 summary](https://nvd.nist.gov/vuln/detail/CVE-2016-20012)
218-
- [Example of GitHub public keys endpoint format](https://github.com/torvalds.keys)
219-
- [PoC video demonstration](https://player.vimeo.com/video/1114162458)
220110

221111
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)