Damn Vulnerable GraphQL Application (DVGA) API Reference
About the App
Contact
https://github.com/dolevf/Damn-Vulnerable-GraphQL-Application
API Endpoints
# Lab Environment:
http://localhost:5013/graphql
Queries
audits
Response
Returns
[AuditObject]
Example
Query
query Audits {
audits {
id
gqloperation
gqlquery
timestamp
}
}
Response
{
"data": {
"audits": [
{
"id": 4,
"gqloperation": "xyz789",
"gqlquery": "xyz789",
"timestamp": "2007-12-03T10:15:30Z"
}
]
}
}
deleteAllPastes
Response
Returns a
Boolean
Example
Query
query DeleteAllPastes {
deleteAllPastes
}
Response
{"data": {"deleteAllPastes": true}}
me
Response
Returns a
UserObject
Arguments
Name | Description |
---|---|
token -
String
|
Example
Query
query Me($token: String) {
me(token: $token) {
id
username
password
}
}
Variables
{"token": "abc123"}
Response
{
"data": {
"me": {
"id": 4,
"username": "xyz789",
"password": "xyz789"
}
}
}
paste
Response
Returns a
PasteObject
Example
Query
query Paste(
$id: Int,
$title: String
) {
paste(
id: $id,
title: $title
) {
id
title
content
public
userAgent
ipAddr
ownerId
burn
owner {
id
name
paste {
...PasteObjectFragment
}
pastes {
...PasteObjectFragment
}
}
}
}
Variables
{"id": 123, "title": "xyz789"}
Response
{
"data": {
"paste": {
"id": "4",
"title": "xyz789",
"content": "abc123",
"public": false,
"userAgent": "xyz789",
"ipAddr": "xyz789",
"ownerId": 987,
"burn": false,
"owner": OwnerObject
}
}
}
pastes
Response
Returns
[PasteObject]
Example
Query
query Pastes(
$public: Boolean,
$limit: Int,
$filter: String
) {
pastes(
public: $public,
limit: $limit,
filter: $filter
) {
id
title
content
public
userAgent
ipAddr
ownerId
burn
owner {
id
name
paste {
...PasteObjectFragment
}
pastes {
...PasteObjectFragment
}
}
}
}
Variables
{
"public": true,
"limit": 987,
"filter": "abc123"
}
Response
{
"data": {
"pastes": [
{
"id": 4,
"title": "xyz789",
"content": "abc123",
"public": false,
"userAgent": "abc123",
"ipAddr": "abc123",
"ownerId": 987,
"burn": true,
"owner": OwnerObject
}
]
}
}
readAndBurn
Response
Returns a
PasteObject
Arguments
Name | Description |
---|---|
id -
Int
|
Example
Query
query ReadAndBurn($id: Int) {
readAndBurn(id: $id) {
id
title
content
public
userAgent
ipAddr
ownerId
burn
owner {
id
name
paste {
...PasteObjectFragment
}
pastes {
...PasteObjectFragment
}
}
}
}
Variables
{"id": 987}
Response
{
"data": {
"readAndBurn": {
"id": 4,
"title": "abc123",
"content": "abc123",
"public": true,
"userAgent": "abc123",
"ipAddr": "abc123",
"ownerId": 123,
"burn": true,
"owner": OwnerObject
}
}
}
search
Response
Returns
[SearchResult]
Arguments
Name | Description |
---|---|
keyword -
String
|
Example
Query
query Search($keyword: String) {
search(keyword: $keyword) {
... on PasteObject {
id
title
content
public
userAgent
ipAddr
ownerId
burn
owner {
...OwnerObjectFragment
}
}
... on UserObject {
id
username
password
}
}
}
Variables
{"keyword": "xyz789"}
Response
{"data": {"search": [PasteObject]}}
systemDebug
systemDiagnostics
Response
Returns a
String
Example
Query
query SystemDiagnostics(
$username: String,
$password: String,
$cmd: String
) {
systemDiagnostics(
username: $username,
password: $password,
cmd: $cmd
)
}
Variables
{
"username": "xyz789",
"password": "abc123",
"cmd": "xyz789"
}
Response
{"data": {"systemDiagnostics": "xyz789"}}
systemHealth
Response
Returns a
String
Example
Query
query SystemHealth {
systemHealth
}
Response
{"data": {"systemHealth": "xyz789"}}
systemUpdate
Response
Returns a
String
Example
Query
query SystemUpdate {
systemUpdate
}
Response
{"data": {"systemUpdate": "xyz789"}}
users
Response
Returns
[UserObject]
Arguments
Name | Description |
---|---|
id -
Int
|
Example
Query
query Users($id: Int) {
users(id: $id) {
id
username
password
}
}
Variables
{"id": 123}
Response
{
"data": {
"users": [
{
"id": 4,
"username": "abc123",
"password": "abc123"
}
]
}
}
Mutations
createPaste
Response
Returns a
CreatePaste
Example
Query
mutation CreatePaste(
$burn: Boolean,
$content: String,
$public: Boolean,
$title: String
) {
createPaste(
burn: $burn,
content: $content,
public: $public,
title: $title
) {
paste {
id
title
content
public
userAgent
ipAddr
ownerId
burn
owner {
...OwnerObjectFragment
}
}
}
}
Variables
{
"burn": false,
"content": "abc123",
"public": true,
"title": "xyz789"
}
Response
{"data": {"createPaste": {"paste": PasteObject}}}
createUser
Response
Returns a
CreateUser
Arguments
Name | Description |
---|---|
userData -
UserInput!
|
Example
Query
mutation CreateUser($userData: UserInput!) {
createUser(userData: $userData) {
user {
id
username
password
}
}
}
Variables
{"userData": UserInput}
Response
{"data": {"createUser": {"user": UserObject}}}
deletePaste
Response
Returns a
DeletePaste
Arguments
Name | Description |
---|---|
id -
Int
|
Example
Query
mutation DeletePaste($id: Int) {
deletePaste(id: $id) {
result
}
}
Variables
{"id": 987}
Response
{"data": {"deletePaste": {"result": true}}}
editPaste
Example
Query
mutation EditPaste(
$content: String,
$id: Int,
$title: String
) {
editPaste(
content: $content,
id: $id,
title: $title
) {
paste {
id
title
content
public
userAgent
ipAddr
ownerId
burn
owner {
...OwnerObjectFragment
}
}
}
}
Variables
{
"content": "abc123",
"id": 123,
"title": "abc123"
}
Response
{"data": {"editPaste": {"paste": PasteObject}}}
importPaste
Response
Returns an
ImportPaste
Example
Query
mutation ImportPaste(
$host: String!,
$path: String!,
$port: Int,
$scheme: String!
) {
importPaste(
host: $host,
path: $path,
port: $port,
scheme: $scheme
) {
result
}
}
Variables
{
"host": "xyz789",
"path": "xyz789",
"port": 987,
"scheme": "abc123"
}
Response
{
"data": {
"importPaste": {"result": "xyz789"}
}
}
login
Example
Query
mutation Login(
$password: String,
$username: String
) {
login(
password: $password,
username: $username
) {
accessToken
refreshToken
}
}
Variables
{
"password": "abc123",
"username": "abc123"
}
Response
{
"data": {
"login": {
"accessToken": "xyz789",
"refreshToken": "xyz789"
}
}
}
uploadPaste
Response
Returns an
UploadPaste
Example
Query
mutation UploadPaste(
$content: String!,
$filename: String!
) {
uploadPaste(
content: $content,
filename: $filename
) {
content
filename
result
}
}
Variables
{
"content": "xyz789",
"filename": "abc123"
}
Response
{
"data": {
"uploadPaste": {
"content": "xyz789",
"filename": "abc123",
"result": "abc123"
}
}
}
Types
AuditObject
Boolean
Description
The Boolean
scalar type represents true
or false
.
CreatePaste
Fields
Field Name | Description |
---|---|
paste -
PasteObject
|
Example
{"paste": PasteObject}
CreateUser
Fields
Field Name | Description |
---|---|
user -
UserObject
|
Example
{"user": UserObject}
DateTime
Description
The DateTime
scalar type represents a DateTime value as specified by
iso8601.
Example
"2007-12-03T10:15:30Z"
DeletePaste
Fields
Field Name | Description |
---|---|
result -
Boolean
|
Example
{"result": true}
EditPaste
Fields
Field Name | Description |
---|---|
paste -
PasteObject
|
Example
{"paste": PasteObject}
ID
Description
The ID
scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4"
) or integer (such as 4
) input value will be accepted as an ID.
Example
"4"
ImportPaste
Fields
Field Name | Description |
---|---|
result -
String
|
Example
{"result": "xyz789"}
Int
Description
The Int
scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
Example
987
Login
OwnerObject
Fields
Field Name | Description |
---|---|
id -
ID!
|
|
name -
String
|
|
paste -
[PasteObject]
|
|
pastes -
[PasteObject]
|
Example
{
"id": "4",
"name": "xyz789",
"paste": [PasteObject],
"pastes": [PasteObject]
}
PasteObject
Example
{
"id": 4,
"title": "abc123",
"content": "abc123",
"public": true,
"userAgent": "abc123",
"ipAddr": "abc123",
"ownerId": 987,
"burn": false,
"owner": OwnerObject
}
SearchResult
Types
Union Types |
---|
Example
PasteObject
String
Description
The String
scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
Example
"xyz789"
UploadPaste
UserInput
UserObject
Subscriptions
paste
Response
Returns a
PasteObject
Example
Query
subscription Paste(
$id: Int,
$title: String
) {
paste(
id: $id,
title: $title
) {
id
title
content
public
userAgent
ipAddr
ownerId
burn
owner {
id
name
paste {
...PasteObjectFragment
}
pastes {
...PasteObjectFragment
}
}
}
}
Variables
{"id": 987, "title": "abc123"}
Response
{
"data": {
"paste": {
"id": "4",
"title": "xyz789",
"content": "xyz789",
"public": false,
"userAgent": "xyz789",
"ipAddr": "xyz789",
"ownerId": 987,
"burn": false,
"owner": OwnerObject
}
}
}