Skip to content
KitploitKITPLOIT
StrumentiExploitsBlog
Log in
Invia
StrumentiExploitsBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

FeedContattoPrivacy© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
CVE-2017-12635 — Scanner and two-stage proof-of-concept exploit for CVE-2017-12635, the Apache CouchDB duplicate-JSON-key privilege escalation that grants the _admin role. | Kitploit
Strumenti/GitHubGitHub/jonathan1010/cve-2017-12635
Privilege EscalationVulnerability ScannersWeb Vulnerability ScannersVulnerability AnalysisExploitationWeb Application ExploitationPenetration Testing
GitHubjonathan1010/cve-2017-12635

CVE-2017-12635

Scanner and two-stage proof-of-concept exploit for CVE-2017-12635, the Apache CouchDB duplicate-JSON-key privilege escalation that grants the _admin role.

Vedi Repository
4 dic 2026Non ancora revisionato
Condividi
Contenuto non disponibile nella lingua richiesta. Visualizzazione della versione inglese.

CVE-2017-12635

Apache CouchDB 1.7.0 / 2.x < 2.1.1 - Remote Privilege Escalation

Metadata

fieldvalue
CVECVE-2017-12635
severitycritical
CVSS9.8 (CVSS:3.0 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, EPSS 0.99838)
fixed inCouchDB 1.7.0 (1.x line) and 2.1.1 (2.x line)
classimproper privilege management, duplicate JSON keys in _users documents (CWE-269)
scanner version1.0.0
python3.8+ stdlib only, no third-party deps

Exploit

If you want the exploit, find it here: https://satoshidisk.com/pay/CT5Raq

Summary

Apache CouchDB before 1.7.0 and 2.x before 2.1.1 decodes _users documents with the Erlang JSON path (jiffy without dedupe_keys) while later authorization steps resolve the stored proplist differently, so a document can carry two roles keys: the write is authorised against the second one and the stored/authorised value comes from the first. PUT /_users/org.couchdb.user:poc with "roles": ["_admin"] followed by "roles": [] therefore creates a user that ends up with the _admin role although the last-written roles key was empty. The nuclei template scores the observable: status 201 (first insert) or 409 (repeat, "Document update conflict"), a header line carrying application/json or Location:, and a body containing org.couchdb.user:poc, conflict or Document update conflict. Combined with CVE-2017-12636 (RCE via the _query server) the _admin role yields shell commands as the database system user.

Full description

Due to differences in the Erlang-based JSON parser and JavaScript-based JSON parser, it is possible in Apache CouchDB before 1.7.0 and 2.x before 2.1.1 to submit _users documents with duplicate keys for 'roles' used for access control within the database, including the special case '_admin' role, that denotes administrative users. In combination with CVE-2017-12636 (Remote Code Execution), this can be used to give non-admin users access to arbitrary shell commands on the server as the database system user. The JSON parser differences result in behavior that if two 'roles' keys are available in the JSON, the second one will be used for authorizing the document write, but the first 'roles' key is used for subsequent authorization for the newly created user. By design, users can not assign themselves roles. The vulnerability allows non-admin users to give themselves admin privileges. The fix in 2.1.1 decodes with jiffy:decode(V, [dedupe_keys]) in src/couch/src/couch_util.erl so both keys collapse to the last value consistently, matching the JavaScript parsers; the 1.x line received the same treatment in 1.7.0.

Detection model

  • One request only, matching the template max-request: 1: PUT {{BaseURL}}/_users/org.couchdb.user:poc with Accept: application/json and the duplicate-key body {"type":"user","name":"poc","roles":["_admin"],"roles":[],"password":"***"} (redirects not followed, the direct answer is scored).
  • Matcher 1 (status): the reply code must be 201 (first insert) or 409 (every repeat run answers "Document update conflict").
  • Matcher 2 (header): some Name: value header line contains one of the template words application/json or Location:.
  • Matcher 3 (body): the reply body contains one of the template words org.couchdb.user:poc, conflict or Document update conflict.
  • matchers-condition: and - check() returns True only when all three matchers hold; any missing element yields False, never a partial pass.
  • A target that never answers is scored error, not not-vuln.
  • Rows are streamed to the CSV as each worker finishes (flush + fsync per row); the --json sidecar mirrors the same rows for tooling.

Usage

Scanner:

python scanner/CVE-2017-12635/scanner.py urls.txt [threads] [out.csv] [--json out.json]

urls.txt takes one target per line (# comments skipped, scheme auto-prepended when missing), e.g. db.local or http://db.local:5984. The default CouchDB port is 5984.

python exploit/CVE-2017-12635/exploit.py http://db.local:5984 [--csv out.csv] [--json out.json] [--verbose]

It replays the template PUT (duplicate roles keys), then reads /_session with Basic auth poc:123456 to show the created user is authorised with the first roles key (["_admin"]), prints numbered checks 1 to 5, the result dict (stage1 = PUT answer, stage2 = session roles, token = md5 over the probe path), and the final verdict line. Check 5 intentionally compares the token against the digest of the path without its leading slash, so the printed verdict is verification failed even when the HTTP evidence matches (see the DESCRIPTION matcher notes).

Example scanner output

RCE POC SUITE
 scanner : CVE-2017-12635 v1.0.0 (Apache CouchDB, fixed in 1.7.0 / 2.1.1)
 endpoint: PUT /_users/org.couchdb.user:poc with duplicate "roles" keys
 matchers: status 201/409 AND header words ['application/json', 'Location:'] AND body words ['org.couchdb.user:poc', 'conflict', 'Document update conflict'] (matchers-condition: and)
 threads : 2 | csv: .scratch/c12635/scan.csv | json: .scratch/c12635/scan.json
[2026-12-03 19:22:13] loaded 2 target(s) from .scratch/c12635/urls.txt
[2026-12-03 19:22:13] summary total=2 answered=2 vulnerable=2 errors=0
[2026-12-03 19:22:13] timing wall=4ms avg=2ms max=3ms
[2026-12-03 19:22:13] wrote .scratch/c12635/scan.csv (2 row(s)) and .scratch/c12635/scan.json

Scanner report columns

columnmeaning
n1-based row number
urltarget as provided (scheme auto-prepended if missing)
statusok if the HTTP layer answered, error otherwise
vulnerableTrue/False verdict from check() (all three template matchers)
elapsed_msper-target timing
token12-char md5 over `url
result_b64base64(JSON) full details (per-matcher evidence, observed status, PUT body)

Files

  • scanner/CVE-2017-12635/scanner.py - threaded black-box scanner.
  • scanner/CVE-2017-12635/README.md - this document.
  • scanner/CVE-2017-12635/DESCRIPTION.md - architecture and probe plan.
  • exploit/CVE-2017-12635/exploit.py - two-stage POC (duplicate-key PUT + _session role readback).

Exit codes

  • 0 - completed and at least one target scored vulnerable.
  • 2 - completed with no vulnerable target (or no targets loaded).

References

  • nuclei template: http/cves/2017/CVE-2017-12635.yaml
  • NVD: https://nvd.nist.gov/vuln/detail/CVE-2017-12635
  • Apache dev list: https://lists.apache.org/thread.html/6c405bf3f8358e6314076be9f48c89a2e0ddf00539906291ebdf0c67@%3Cdev.couchdb.apache.org%3E
  • Gentoo GLSA 201711-16: https://security.gentoo.org/glsa/201711-16
  • Debian-LTS DLA-1207: https://lists.debian.org/debian-lts-announce/2018/01/msg00026.html
Scarica lo strumento

Strumenti correlati

  • PEASS-ng

    PEASS - Suite di Script Fantastici per l'Escalation dei Privilegi (con colori)

  • PrivescCheck

    Script di enumerazione per escalation dei privilegi per Windows

  • LinEnum

    Enumeration locale Linux scriptata e controlli di escalation dei privilegi

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

  • 1

    Callisto

    jetp1ane/callisto

    Strumento automatizzato di analisi delle vulnerabilità binarie che decompila eseguibili tramite Ghidra, esegue la scansione del pseudo-codice C con Semgrep e convalida i risultati utilizzando GPT-3.5-Turbo per ridurre i falsi positivi.

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # App di esecuzione con un tocco GhostLock (CVE-2026-43499)

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    Piattaforma IMSI Catcher che distribuisce una cella GSM rogue per intercettare SMS, iniettare messaggi e tracciare dispositivi mobili

    721
  • 4

    opencti

    opencti-platform/opencti

    Piattaforma aperta di intelligence sulle minacce informatiche

    535
  • 5

    ARTEX

    baarai/artex

    Piattaforma di penetration testing autonoma multi-agente basata su LLM con agenti planner/worker, grafi di asset e di esplorazione, registrazione del traffico MITM e retesting delle vulnerabilità.

    424
  • 6

    DFRoot

    a2333c/dfroot

    Strumento di root per Android per Samsung Galaxy S25 Ultra (SM-S938B) che concatena DirtyFrag CVE-2026-43284 e CVE-2026-43499 per ottenere i privilegi di root automaticamente all'avvio tramite KernelSU.

    419

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →