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

The Latest API Security News, Vulnerabilities and Best Practices
Issue: #133
Vulnerable Peloton APIs, API contract generation for .NET
This week, we take a look at the API vulnerabilities discovered at Peloton, how India is locking down the APIs for their COVID vaccination portal, how API contracts can be generated from .NET code, and what API security sessions the upcoming RSA Conference (RSAC) offers.
Vulnerability: Peloton
 

Peloton is a producer of popular treadmills and stationary bicycles, as wells as a subscription service for training on the equipment. Jan Masters from Pen Test Partners found that the APIs behind the service were highly vulnerable and leaking personal user data.

The information that attackers could get included such details as:

  • User IDs
  • Instructor IDs
  • Group membership
  • Location
  • Workout stats
  • Gender and age

The APIs initially had no authentication at all, but it was silently added after Masters first contacted Peloton. However, there still was no authorization, so anyone with a Peloton ID (and there are more than 3 million of them, and you can self-register!) could still retrieve the data on any other user. This applied even to profiles set as private:

GraphQL vulnerabilities are also involved: besides the main APIs, there were also multiple unprotected GraphQL endpoints.

And, finally, the company could not provide information on whether or not the vulnerability was ever exploited by malicious actors.

Lessons learned:

  • Keep an inventory of all your APIs — there should not be any APIs exposing your production data and systems unbeknownst to you.
  • All APIs must be protected with both authentication and authorization.
  • APIs must not expose more information than strictly necessary for the service or product calling to work properly.
  • Logging and monitoring become really valuable when a breach actually occurs.
API lockdown: Vaccination in India
 

As you probably know, these are extremely challenging times in India. With the huge spike of COVID cases and overloaded medical systems, there has been a rush for vaccines. This has led to people finding the APIs behind India’s CoWIN vaccination booking portal.

The APIs were originally made public so that private hospitals could integrate them into their systems to facilitate faster vaccination. But with the scrambling for vaccinations, websites, Telegram bots, messenger groups, and so on got created to ping the APIs all the time to find free vaccination slots. As result, each time new slots appeared, they were rapidly taken. A technical capability quickly became a social and governance issue.

Now the CoWIN portal has locked down the API use:

  • Rate limit of 100 API calls per 5 minutes per IP address.
  • Automated bookings through bots or scripts are not possible since bookings can be done only through the CoWIN portal and require entering a one-time password that is sent to the user’s mobile phone.

This is a story of unintended consequences of openness. APIs can be a great enabler, and these APIs were clearly created with the best of intentions. However, make sure that APIs that you create are limited to the target audience that you had in mind and have the security mechanisms (authentication, authorization, data validation, rate limiting, and so on) to protect the intended use.

And needless to say that our hearts go to the people of India and we hope that this crisis goes away as quickly as possible.

Best practices: Generate OpenAPI from .NET annotations
 

Code-first is the approach in which API contracts and documentation get generated based on the actual implementation code.

In issue 131, we covered how this can be done from Java Spring code. Now it’s time for .NET.

Edgar Silva has written a blog post on using Swashbuckle and NSwag annotations to create high-quality OpenAPI contracts from .NET Core.

For example:

using System.ComponentModel.DataAnnotations;
using System;

namespace TodoApi.Models
{
public class Person
{
[Required, RegularExpression("/^[a-zA-Z ]{2,100}$/"),MinLength(5),MaxLength(100)]
public string firstName { get; set; }
[Required, RegularExpression("/^[a-zA-Z ]{2,100}$/"),MinLength(5),MaxLength(100)]
public string lastName { get; set; }
[Required, Range(1, long.MaxValue)]
public long id { get; set; }
[Required, Range(0, 150)]
public int age { get; set; }
}
}

If you work with .NET, do check it out!

Conferences: AppSec Village at RSAC 2021
 

As with all the industry events these days, RSA Conference 2021 (May 17—20) has had to go virtual. If you are taking this opportunity to get some great content from the comfort of your home office, check out the API security sessions of the AppSec Village track.

This includes some great presenters, such as Erez Yalon, David Sopas, Tanya Janca, and others. A full conference pass is required.

 
 
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 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

Issue 130: GitHub’s new token format, MindAPI, Kiterunner

Thursday, April 22, 2021

Hi, this week we look at API token best practices, and tools for API recon & pentesting APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #130 GitHub's new

Issue 129: Facebook and Clubhouse profiles scraped through APIs, Forrester’s “State of Application Security, 2021”📑

Monday, April 19, 2021

Hi, today we look at the huge API data leaks at Facebook and Clubhouse, Forrester's APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #129 Facebook and

Issue 128: API flaws at VMware and GitLab, URL parameters and SSRF, webinar on recent breaches 🎬

Thursday, April 8, 2021

Hi, this week we look at a couple of recent API flaws, the dangers of URL parameters & APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #128 API flaws at

You Might Also Like

Issue #573: Ray browser, focus shift, and Nimrods

Friday, December 27, 2024

View this email in your browser Issue #573 - December 27th 2024 Weekly newsletter about Web Game Development. If you have anything you want to share with our community please let me know by replying to

Palo Alto Releases Patch for PAN-OS DoS Flaw — Update Immediately

Friday, December 27, 2024

THN Daily Updates Newsletter cover Backups: The Key to Cybersecurity How Much Cybersecurity is Enough? Recovery + Resistance = Resilience Download Now Sponsored LATEST NEWS Dec 27, 2024 Cloud Atlas

SWLW #631: You can’t measure productivity, Ask uncommonly clear questions, and more.

Friday, December 27, 2024

Weekly articles & videos about people, culture and leadership: everything you need to design the org that makes the product. A weekly newsletter by Oren Ellenbogen with the best content I found

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