Issue 136: OAuth 2.0 security checklist and pentesting ✔️

The Latest API Security News, Vulnerabilities and Best Practices
Issue: #136
OAuth 2.0 security checklist and pentesting
This week, we check out how API attacks can be used to squash political dissent, a handy OAuth 2.0 security checklist as well as some common OAuth vulnerabilities and the ways to detect and mitigate them, and a case study of API penetration testing.
Vulnerability: Russian opposition email list breach
 

Companies typically avoid providing details on their data breaches. Today we have a rare exception. The staff of the Russian opposition leader, Alexey Navalny, has posted a detailed report on both the breach they had earlier this year and their investigation into the breach. Unfortunately, the report is in Russian, so you might need to use Google Translate or auto-generated English subtitles in the video version that they posted on YouTube.

When Navalny got imprisoned earlier this year, his supporters set up a website to campaign for his release. The site collected supporters’ email addresses and approximate postal addresses to be used to coordinate public protests across the country.

Right before the protests, attackers that are believed to be connected to the Russian government leaked the list of the email addresses. Later, they used the email addresses along with additional data from government sources (names, registration addresses, dates of birth, employer information) to intimidate the supporters and their employers. The consequences have been very real, with multiple reports of people losing their jobs as a result.

According to the investigation, attackers got in through the API of the mass email system, Mailgun, that the campaign used.

  1. One of the former administrators of the system (fired years before the breach) had retained an API key to Mailgun issued to the campaign.
  2. The ex-admin used the API key for a scraping script to extract the email addresses from Mailgun. This script had built-in delays to avoid getting throttled or causing suspicious spikes, thus not raising an alarm.
  3. Looks like there were early reports of the ex-admin possessing at least some of the email addresses as early as January this year, but the reports were ignored at that time.

The investigators managed to correlate Mailgun logs and the leaked data to prove that this was indeed the system that was breached and that no other system or data got compromised.

Quite a few lessons learned here:

  • Personally identifiable information (PII) can be extremely sensitive, and even just breached email addresses can lead to very tangible real-life consequences.
  • We live in a world in which breached PII can be augmented with data from other sources and thus further weaponized.
  • Long-living API keys are extremely dangerous and must be avoided. Use OAuth whenever possible, and frequently rotate API keys if not.
  • Limit API key access, issue the keys with minimal permissions, control which employees have access to the keys, deprovision the keys when employees who potentially have access to them depart the company.
  • Use IP whitelisting and check IP addresses in the logs to ensure that only the expected client call your APIs.
  • Monitor API logs.
  • Take any reports on data leaks seriously and investigate and treat them promptly.
OAuth2: Security checklist
 

Researchers from Binary Brotherhood have taken IETF OAuth 2.0 Security Best Current Practice and added other common OAuth2 vulnerability lists that they found on the internet to compile their well-rounded OAuth 2.0 Pentest Checklist.

Check out their page for the detailed checklist and links to additional resources.

oauth2.0_security_testing_mindmap_main

 

OAuth2: Common vulnerabilities and mitigation
 

Nishith K has posted both an introduction to OAuth 2.0 and details on the following common vulnerabilities:

  • Improper implementation of the implicit grant type
  • Flawed cross-site request forgery (CSRF) protection
  • Leaking authorization codes and access tokens
  • Flawed scope validation
  • Unverified user registration
  • Host header injection
  • Reusable OAuth access tokens
Best practices: Penetration testing case study
 

A researcher going by the name of Bend Theory has posted details on his API penetration testing process:

  • Google Dorking, or using Google search techniques to locate JavaScript and other files that contain API endpoint references
  • Using web apps in the browser while proxying calls through Burp
  • Analyzing JavaScript files and endpoints, including BurpJSLinkFinder plugin and Python scripts
  • Wordlists
  • CLI recon tools, such as gau, qsreplace, httpx, LinkFinder, dirsearch, ffuf, kiterunner, urlscan.io

He then gives examples on the approach he used to discover a couple of recent real-life vulnerabilities:

  • A profile access API call leaking user profile data due to BOLA/IDOR
  • API information disclosure and privilege escalation to administrative access
 
 
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 135: Millions stolen from cryptoexchanges through APIs 💱

Thursday, May 27, 2021

Hi, today we look at the recent Rocket.Chat API vulnerability, cybercriminals exploiting cryptoexchange API keys, effect of Let's Encrypt root APIsecurity.io The Latest API Security News,

Issue 134: API vulnerabilities at Echelon, Instagram, Facebook Workspace

Thursday, May 20, 2021

Hi, today we look into details of 3 recent API vulnerability reports and have an RSCA interview with Forrester's Sandy Carielli APIsecurity.io The Latest API Security News, Vulnerabilities and Best

Issue 133: Vulnerable Peloton APIs, API contract generation for .NET 💻

Friday, May 14, 2021

Hi, this week we look at Peloton and India's CoWIN, OpenAPI contracts based on .NET annotations, API Security sessions at RSAC AppSec Village APIsecurity.io The Latest API Security News,

Issue 132: Experian API leak, breaches at DigitalOcean and Geico, Burp plugins, vAPI lab

Thursday, May 6, 2021

Hi, this week we look at new API tools & recent Experian, DigitalOcean, Geiko, Facebook APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #132 Experian API leak

Issue 131: API vulnerabilities at John Deere, Springfox, JWT lab, AutoGraphQL 🔎

Thursday, April 29, 2021

Hi, this week, we look at the recent API vulnerability in farming machinery and a few APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #131 API vulnerabilities at

You Might Also Like

Help Shape the Future of Laravel News - Quick Survey

Friday, December 27, 2024

Help shape Laravel News - Quick 2-minute survey Hi there, As a valued member of the Laravel News community, we'd love to hear your thoughts to help us make our newsletter even better in 2025. Would

Data Science Weekly - Issue 579

Thursday, December 26, 2024

Curated news, articles and jobs related to Data Science, AI, & Machine Learning ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

💎 Issue 449 - JRuby with JBang

Thursday, December 26, 2024

This week's Awesome Ruby Newsletter Read this email on the Web The Awesome Ruby Newsletter Issue » 449 Release Date Dec 26, 2024 Your weekly report of the most popular Ruby news, articles and

💻 Issue 449 - JavaScript Benchmarking Is a Mess

Thursday, December 26, 2024

This week's Awesome JavaScript Weekly Read this email on the Web The Awesome JavaScript Weekly Issue » 449 Release Date Dec 26, 2024 Your weekly report of the most popular JavaScript news, articles

📱 Issue 443 - EU asks for views on plan to force Apple to open up iOS

Thursday, December 26, 2024

This week's Awesome iOS Weekly Read this email on the Web The Awesome iOS Weekly Issue » 443 Release Date Dec 26, 2024 Your weekly report of the most popular iOS news, articles and projects Popular

💻 Issue 442 - SOLID: The Liskov Substitution Principle (LSP) in C#

Thursday, December 26, 2024

This week's Awesome .NET Weekly Read this email on the Web The Awesome .NET Weekly Issue » 442 Release Date Dec 26, 2024 Your weekly report of the most popular .NET news, articles and projects

Daily Coding Problem: Problem #1649 [Easy]

Thursday, December 26, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Dropbox. Spreadsheets often use this alphabetical encoding for its columns: "A

JSK Daily for Dec 26, 2024

Thursday, December 26, 2024

JSK Daily for Dec 26, 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

📱 Issue 446 - Fatbobman's Swift Weekly #063

Thursday, December 26, 2024

This week's Awesome Swift Weekly Read this email on the Web The Awesome Swift Weekly Issue » 446 Release Date Dec 26, 2024 Your weekly report of the most popular Swift news, articles and projects

💻 Issue 444 - Four limitations of Rust’s borrow checker

Thursday, December 26, 2024

This week's Awesome Rust Weekly Read this email on the Web The Awesome Rust Weekly Issue » 444 Release Date Dec 26, 2024 Your weekly report of the most popular Rust news, articles and projects