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

Quick question

Sunday, April 28, 2024

I want to learn how I can better serve you ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Kotlin Weekly #404 (NOT FOUND)

Sunday, April 28, 2024

ISSUE #404 28st of April 2024 Announcements Kotlin Multiplatform State of the Art Survey 2024 Help to shape and understand the Kotlin Multiplatform Ecosystem! It takes 4 minutes to fill this survey.

📲 Why Is It Called Bluetooth? — Check Out This AI Text to Song Generator

Sunday, April 28, 2024

Also: What to Know About Emulating Games on iPhone, and More! How-To Geek Logo April 28, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your

Daily Coding Problem: Problem #1425 [Easy]

Sunday, April 28, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Microsoft. Suppose an arithmetic expression is given as a binary tree. Each leaf is an

PD#571 Software Design Principles I Learned the Hard Way

Sunday, April 28, 2024

If there's two sources of truth, one is probably wrong. And yes, please repeat yourself. ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

When Procrastination is Productive & Ghost integrating with ActivityPub

Sunday, April 28, 2024

Automattic, Texts, and Beeper join forces to build world's best inbox, Reflect launches its iOS app, how to start small rituals, and a lot more in this week's issue of Creativerly. Creativerly

C#503 Building pipelines with System.Threading.Channels

Sunday, April 28, 2024

Concurrent programming challenges can be effectively addressed using channels ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

RD#453 Get your codebase ready for React 19

Sunday, April 28, 2024

Is your app ready for what's coming up in React 19's release ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

☁️ Azure Weekly #464 - 28th April 2024

Sunday, April 28, 2024

Azure Weekly Newsletter Issue #464 powered by endjin Welcome to issue 464 of the Azure Weekly Newsletter. In AI we have a good mix of high-level and deep-dive technical articles. Next-Gen Customer

Tesla profits tumble, Fisker flatlines, and California cities battle for control of AVs

Sunday, April 28, 2024

Plus, an up-close look at the all-electric Mercedes G-Wagen and more View this email online in your browser By Kirsten Korosec Sunday, April 28, 2024 Welcome back to TechCrunch Mobility — your central