Damn Vulnerable GraphQL Application is an intentionally vulnerable implementation of Facebook's GraphQL technology, to learn and practice GraphQL Security.
This is a fork of dolevf/Damn-Vulnerable-GraphQL-Application, run as a GraphQL evaluation target on AgenticSec's staging environment. It is reachable only from a single managed-edge egress IP; it is not a public deployment.
Upstream DVGA has two operation modes, Beginner and Expert, held in a
server-wide row in SQLite. Any unauthenticated caller can change it —
GET /difficulty/<level>, an X-DVGA-MODE header on any request (including
POST /graphql), or GET /start_over, which rebuilds the database outright.
That makes the mode useless as a test condition: whatever is being evaluated
against the target can silently flip it.
Expert mode is also not one control but six — introspection off, GraphiQL
off, query depth limit, query cost limit, a deny list, and an operation-name
allow list. The allow list rejects every named operation outside a fixed set of
six, so an ordinary query Foo { ... } comes back 400 and the whole endpoint
looks unreachable.
This fork keeps only the two that matter for the intended scenario and makes them permanent:
| Behaviour | Upstream | This fork |
|---|---|---|
Introspection (__schema) |
on in Beginner, off in Expert | always refused |
Introspection (__type) |
always on | always refused |
GraphiQL (/graphiql) |
on in Beginner, off in Expert | always refused |
| Query depth / cost / deny list / operation-name allow list / shell command restrictions | off in Beginner, on in Expert | always off |
GET /difficulty/<level> |
changes the mode | removed (404) |
X-DVGA-MODE header |
changes the mode | removed (ignored) |
GET /start_over |
rebuilds the DB and pastes/ |
removed (404) |
Every vulnerability that does not depend on the mode is untouched and still
exploitable: SQL injection, stored XSS, SSRF via ImportPaste, OS command
injection, JWT forgery (signatures are not verified), arbitrary file write, the
weak changeme password, deleteAllPastes, and the rest. /solutions is
still served.
Two build fixes came along with it: the flask-sockets dependency is pinned to
a commit instead of @master, and the apt line in the Dockerfile actually
installs curl now (upstream's was a no-op that only exited 0 because the base
image already had it).
Upstream's own test suite is not run here and parts of it will not pass —
tests/test_mode.py, tests/test_rollback.py, and the mode-switching cases in
tests/test_introspect.py and tests/test_vulnerabilities.py all drive the
endpoints this fork removed. The upstream GitHub Actions workflow was deleted
rather than left to fail on runners and Python versions that no longer exist.
WEB_HOST defaults to 127.0.0.1, so a container started without it comes up
healthy and answers nothing:
docker run -d -e WEB_HOST=0.0.0.0 -p 5013:5013 <image>- About DVGA
- Operation Modes
- Scenarios
- Prerequisites
- Installation
- Screenshots
- Maintainers
- Contributors
- Mentions
- Disclaimer
- License
Damn Vulnerable GraphQL is a deliberately weak and insecure implementation of GraphQL that provides a safe environment to attack a GraphQL application, allowing developers and IT professionals to test for vulnerabilities.
- Queries
- Mutations
- Subscriptions
DVGA has numerous flaws, such as Injections, Code Executions, Bypasses, Denial of Service, and more. See the full list under the Scenarios section. A public Postman collection is also available to replay solutions to the challenges. You can import the collection by clicking on the Run in Postman button below.
DVGA supports Beginner and Expert level game modes, which will change the exploitation difficulty.
- Reconnaissance
- Discovering GraphQL
- Fingerprinting GraphQL
- Denial of Service
- Batch Query Attack
- Deep Recursion Query Attack
- Resource Intensive Query Attack
- Field Duplication Attack
- Aliases based Attack
- Information Disclosure
- GraphQL Introspection
- GraphiQL Interface
- GraphQL Field Suggestions
- Server Side Request Forgery
- Stack Trace Errors
- Code Execution
- OS Command Injection #1
- OS Command Injection #2
- Injection
- Stored Cross Site Scripting
- Log spoofing / Log Injection
- HTML Injection
- SQL Injection
- Authorization Bypass
- GraphQL JWT Token Forge
- GraphQL Interface Protection Bypass
- GraphQL Query Deny List Bypass
- Miscellaneous
- GraphQL Query Weak Password Protection
- Arbitrary File Write // Path Traversal
The following Python3 libraries are required:
- Python3 (3.6 - 3.10)
- Flask
- Flask-SQLAlchemy
- Flask-Sockets
- Gevent
- Graphene
- Graphene-SQLAlchemy
- Rx
See requirements.txt for dependencies.
git clone https://github.com/dolevf/Damn-Vulnerable-GraphQL-Application.git && cd Damn-Vulnerable-GraphQL-Application
docker build -t dvga .
docker run -d -t -p 5013:5013 -e WEB_HOST=0.0.0.0 --name dvga dvga
In your browser, navigate to http://localhost:5013
Note: if you need the application to bind on a specific port (e.g. 8080), use -e WEB_PORT=8080.
docker pull dolevf/dvga
Docker Hub image: dolevf/dvga
docker run -t -p 5013:5013 -e WEB_HOST=0.0.0.0 dolevf/dvga
In your browser, navigate to http://localhost:5013
cd /opt/
git clone git@github.com:dolevf/Damn-Vulnerable-GraphQL-Application.git && cd Damn-Vulnerable-GraphQL-Application
pip3 install -r requirements.txt
python3 app.py
In your browser, navigate to http://localhost:5013.
A big Thank You to the kind people who helped make DVGA better:
- Black Hat GraphQL - No Starch Press
- OWASP Vulnerable Web Applications Directory
- GraphQL Weekly
- DZone API Security Weekly
- KitPloit
- tl;dr sec #72
- Intigriti Blog
- STÖK - Bounty Thursdays #26
- Brakeing Security 2021-007
- Yes We Hack - How to Exploit GraphQL
- GraphQL Editor
- GraphQL Hacking (Portuguese)
- InQL GraphQL Scanner Demo
- H4ck3d - Security Conference 2021 (Spanish)
- Christina Hasternath - GraphQLConf 2021
- Hacking APIs (Ch14) by Corey Ball - No Starch Press
- Hacking Simplified Part #1
- Hacking Simplified Part #2
- Hacking Simplified Part #3
DVGA is highly insecure, and as such, should not be deployed on internet facing servers. By default, the application is listening on 127.0.0.1 to avoid misconfigurations.
DVGA is intentionally flawed and vulnerable, as such, it comes with no warranties. By using DVGA, you take full responsibility for using it.
It is distributed under the MIT License. See LICENSE for more information.




