DEV Community

Cover image for Lab: Accessing private GraphQL posts
tRavOndAtrACk
tRavOndAtrACk

Posted on

Lab: Accessing private GraphQL posts

Author: travondatrack
Date: 14/01/2026
Category: Pentest | Web | Security
Difficulty: Easy
Tags: GraphQL


Mô tả

The blog page for this lab contains a hidden blog post that has a secret password. To solve the lab, find the hidden blog post and enter the password.

Link: https://portswigger.net/web-security/graphql/lab-graphql-reading-private-posts


Phân tích vấn đề

Recon

  • Truy cập blog page → các bài post được load qua POST request tới /graphql/v1
  • Trong response, các post có ID tuần tự: 1, 2, 4, 5... → thiếu ID 3 → nghi ngờ có post ẩn với ID = 3

  • Post 3 bị ẩn


Khai thác

Bước 1: Chèn 1 query đặc biệt

  • Trong Repeater, right-click → GraphQL > Set introspection query
  • Send request → response trả về full schema

  • Tìm type BlogPost → phát hiện field postPassword tồn tại

Bước 2: Query post ẩn với ID = 3 và lấy postPassword

  • Trong Repeater, chuyển sang tab GraphQL
  • Variables panel: thay "id": 1 thành "id": 3
  • Query panel: thêm field postPassword vào bên trong getBlogPost(id: $id)
query {
  getBlogPost(id: 3) {
    id
    title
    isPrivate
    postPassword
    summary
  }
}
Enter fullscreen mode Exit fullscreen mode

--> Đã lấy được mật khẩu của post có id=3.
### Submit

Top comments (0)