Issue 121: Vulnerability at chess.com, GraphQL security playground and checklist 📝

The Latest API Security News, Vulnerabilities and Best Practices
Issue: #121
Vulnerability at chess. com, GraphQL security playground and checklist
This week, we take a look at the recent API vulnerability at chess.com, resources for GraphQL API security, and some API security advice from Michael Cobb at TechTarget.
Vulnerability: chess. com
 

Sam Curry found an API vulnerability that allowed arbitrary account takeover in chess.com, a popular online chess community and app.

Community members can exchange messages, both online and in the app. Hence, there is an API powering that feature and locating user records. Unfortunately, this API was exposing way too much information than was required for sending a message to a user.

So a call like the following, looking for a user with the username hikaru:

GET /v1/users?loginToken=98a161...&username=hikaru&signed=iOS3.9.7-7b9f... 
HTTP/1.1 Host: api.chess.com

Returned this kind of response:

{
  "status": "success",
  "data": {
    "email": "REDACTED",
    "premium_status": 3,
    "id": 15448422,
    "uuid": "REDACTED",
    "country_id": 2,
    "avatar_url": "REDACTED",
    "last_login_date": REDACTED,
    "session_id": "REDACTED",
    "location": "Sunrise, Florida",
    "username": "Hikaru",
    "points": 52,
    "chess_title": "GM",
    "first_name": "Hikaru Nakamura",
    "last_name": null,
    "country_name": "United States",
    "member_since": REDACTED,
    "about": "",
    "is_blocked": false,
    "is_tracked": false,
    "are_friends": false,
    "friend_request_exists": true,
    "is_able_to_change_username": null,
    "flair_code": "diamond_traditional",
    "show_ads": true,
    "is_fair_play_agreed": true
  }
}

The response included some personal information about the user, like the email address. Even worse, the session_id field in the response turned out to be the security token that authenticates the user! So after a simple call to find a user, an attacker would be able to log in as that user and take over the account.

But that was not the end of it. Even worse, Curry discovered that for an admin user, he could use that token to log in to admin .chess .com, the administrative console for the entire community, and take over everything with the admin account.

This is a classic case of the OWASP API3:2019 — Excessive data exposure vulnerability. To prevent it:

  • Properly define the response schemas of each API operation.
  • Review the response schemas to keep the exposed data to the bare minimum necessary for the application. Avoid exposing any sensitive information should the data get into attackers’ hands.
  • Finally, enforce these responses with proper validation of any outgoing data.
Resources: Damn Vulnerable GraphQL Application
 

Damn Vulnerable GraphQL Application (DVGA) by Dolev Farhi and Connor McKinnon is a purpose-built, highly insecure GraphQL application. You can use it as a playground to see some of the most frequent GraphQL vulnerabilities in action.

The application currently covers the following GraphQL vulnerability scenarios:

  • Denial of Service
    • Batch Query Attack
    • Deep Recursion Query Attack
    • Resource Intensive Query Attack
  • Information Disclosure
    • GraphQL Introspection
    • GraphQL Interface
    • GraphQL Field Suggestions
    • Server-Side Request Forgery
  • Code Execution
    • OS Command Injection #1
    • OS Command Injection #2
  • Injection
    • Stored Cross-Site Scripting
    • Log spoofing / Log Injection
    • HTML Injection
  • Authorization Bypass
    • GraphQL Interface Protection Bypass
    • GraphQL Query Deny List Bypass
  • Miscellaneous
    • GraphQL Query Weak Password Protection
    • Arbitrary File Write / Path Traversal
Resources: GraphQL Security Cheat Sheet
 

If you are on the defending side in GraphQL and want to protect your GraphQL APIs, check out this GraphQL Security Cheat Sheet from OWASP.

This page provides guidance on how to implement the following in GraphQL:

  • Input validation
  • DoS protection
  • Access control
  • Security configuration
Opinion: API security guidelines
 

TechTarget has published the top 10 API security guidelines and best practices from Michael Cobb. Arguably, to me personally, some of these look slightly contestable, but Cobb does a good job in explaining why he put each on the list. Below is the quick list. Check out the original article for more details:

  1. Understand the full scope of secure API consumption
  2. Validate the data
  3. Choose your web services API: SOAP vs. REST
  4. Record APIs in an API registry
  5. Assess your API risks
  6. Be diligent about API documentation
  7. Lock down access to APIs
  8. Specify authentication and access
  9. Stash your API keys
  10. Add AI to API monitoring and threat detection
Vote for Us
 

If you have not done that yet, please vote for our newsletter in the 2020 DZone Audience Awards by picking Dmitry Sotnikov (me ;)) here.

Your vote will help us spread the word and raise awareness of API security.

Huge thanks in advance!

 
 
Thanks for reading.

That's it for today. If you have any feedback or stories to share, simply reply to this email.

Please forward the newsletter to your friends and colleagues who might benefit from it.

 
42Crunch, Inc.   95 Third Street  2nd Floor  San Francisco  CA   94103   United States
You received this email because you are subscribed to API Security News from 42Crunch, Inc..

Update your email preferences to choose the types of emails you receive or Unsubscribe from all future emails  
 
 

Older messages

Issue 120: Video doorbells security flaws, intro to JWT attacks, security zines

Saturday, February 13, 2021

Hi, this week (besides security flaws) we have tutorials on JWT, AuthZ & AuthN, K8S APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #120 Video doorbells

Issue 119: NoxPlayer supply-chain attack through a hacked API 📲

Thursday, February 4, 2021

Hi , today we look at NoxPlayer API attack, Radware state of web sec report, Azure API m APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #119 NoxPlayer supply-

Issue 118: Spring Framework ALPS, OAuth 2.0 attack mindmap, securing JWTs 📜

Thursday, January 28, 2021

Hi, today we look at potential API exposure via Spring ALPS, OAuth 2.0 attacks, JWT and APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #118 Spring Framework ALPS

Issue 116: Facebook and Parler API vulnerabilities, clairvoyance 🔭

Friday, January 15, 2021

Hi , this week we look at a recent Facebook vulnerability, Parler breach, GraphQL recon APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #116 Facebook and Parler

Issue 115: Vulnerabilities in SolarWinds, Ledger, Outlook, new plugin for JetBrains IDEs 🛠️

Thursday, January 7, 2021

Hi, today we look at the API aspects of SolarWinds and Ledger breaches, Outlook JWT... APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #115 Vulnerabilities in

You Might Also Like

📧 What Rewriting a 40-Year-Old Project Taught Me About Software Development

Saturday, December 28, 2024

​ What Rewriting a 40-Year-Old Project Taught Me About Software Development Read on: m​y website / Read time: 7 minutes The .NET Weekly is brought to you by: As the year wraps up, it's clear API

This Week in Rust #579

Saturday, December 28, 2024

Email isn't displaying correctly? Read this e-mail on the Web This Week in Rust issue 579 — 25 DEC 2024 Hello and welcome to another issue of This Week in Rust! Rust is a programming language

The Calm Voice Of Chaos 🏆

Friday, December 27, 2024

The protest singer whose songs shaped 2024. Here's a version for your browser. Hunting for the end of the long tail • December 27, 2024 The Calm Voice Of Chaos This year's Tedium awards start

JSK Daily for Dec 27, 2024

Friday, December 27, 2024

JSK Daily for Dec 27, 2024 View this email in your browser A community curated daily e-mail of JavaScript news Performance Optimization in React Pivot Table with Data Compression The Syncfusion React

Daily Coding Problem: Problem #1650 [Hard]

Friday, December 27, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Microsoft. Recall that the minimum spanning tree is the subset of edges of a tree that

🧠 3 Ways Quantum Computing Will Change Our World — How to Transfer Data to Your New iPhone

Friday, December 27, 2024

Also: Great Spotify Features That Apple Music Has Too, and More! How-To Geek Logo December 27, 2024 Did You Know 2004 was the last year that hidden (or "pop-up") headlamps appeared on a mass-

Charted | How U.S. Household Incomes Have Changed (1967-2023) 💰

Friday, December 27, 2024

When looking at inflation adjusted data, US households have definitely gotten a whole lot richer since 1967. View Online | Subscribe | Download Our App FEATURED STORY How US Household Incomes Have

Can Pirates Save Democracy?

Friday, December 27, 2024

Top Tech Content sent at Noon! Boost Your Article on HackerNoon for $159.99! Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, December 27, 2024? The

The 2025 Predictions You Can't Afford to Miss 🔮

Friday, December 27, 2024

Get a head start on what's to come in the New Year. Join VC+ to gain access to our 2025 Global Forecast Series and other exclusive insights! View email in browser HOW LEADERS STAY AHEAD IN 2025 The

DeveloPassion's Newsletter #182 - 2024 Retrospective

Friday, December 27, 2024

A newsletter discussing Knowledge Management, Knowledge Work, Zen Productivity, Personal Organization, and more! Sébastien Dubois DeveloPassion's Newsletter DeveloPassion's Newsletter #182 -