APIsecurity.io - Issue 97: How to not leak API keys

The Latest API Security News, Vulnerabilities and Best Practices
Issue: #97
Gym apps & home automation vulnerabilities, how to not leak API keys
This week, we check out the recent API vulnerabilities in the gym management platform Fizikal and the HDL smart home automation. We also have a great detailed write-up on a Capture the Flag challenge, and a talk on leaking API keys.
Vulnerability: Fizikal
 

Apps use platforms to get to the market faster and to avoid re-inventing the wheel. As a flip side, sometimes the security issues of these platforms can come and bite them.

Fizikal is a management platform for gym apps that is used in about 80 different apps, with a total of about 240 000 users. Sahar Avitan from Security Joes found a set of vulnerabilities in Fizikal’s APIs that allowed attackers to find users on the platform and extract their profile information or take over their accounts.

As often happens, the password reset API was the weakest link. Avitan found out that he could make a call to it and supply a phone number as a parameter. The API response was different for phone numbers that existed in the platform  than on those that didn’t. As phone numbers are easy to enumerate, this gave attackers a way to find who had and account and who did not.

In the next step, the reset code turned out to be just a four digit number, resulting in  just 10 000 possible combinations to try. A lack of proper rate limiting on the API made it simple to brute-force and enumerate all combinations. All this culminated in a full account takeover, meaning that attackers could retrieve personal details, like:

  • Phone number
  • Full name
  • Date of birth
  • Email address
  • Postal address
  • ID number
  • Gym attendance schedule

Powerful stuff, especially when combined properly. To avoid similar API vulnerabilities:

Vulnerability: HDL Automation
 

Barak Sternberg did a presentation at DEF CON on the vulnerabilities that he found in the HDL Automation smart home and building management system:

  • The endpoint /api/GetRoomBindingDevice was vulnerable to SQL injection and thus leaking information about devices and users.
  • The configuration management created shadow accounts for all user accounts. These shadow accounts had -debug added to them (as is user-debug@email.com). So, if a user’s email was from public email service like Gmail, attackers could just register a mailbox for the valid shadow account with the -debug and use APIs to reset the password for the shadow account to get full access to account configuration.

Click the link above to read the summary of the story in BleepingComputer, or watch the full recording from DEF CON below:

Lessons learned here:

Hackathons: Capture The Flag challenge
 

Capture the Flag (CTF) is a popular format of hackathon challenges in which participants need to break into an intentionally vulnerable system.

Here is a nice detailed write-up by Brett Buerhaus on solving a CTF challenge at the recent HackerOne HacktivityCon 2020. The challenge included:

  • Finding and exploring an API vulnerability
  • Endpoint discovery
  • Server-Side Request Forgery (SSRF)
  • SQL injections
  • Cross-Site Scripting (XSS)

If you ever wanted to follow a breakdown on this kind of challenge, this is a prime candidate for it.

Videos: API keys
 

Leaked API keys remain one of the key sources of API breaches. See this recording of the Red Team Village session “Have my keys been pwned? – API Edition”  by Jose Hernandez and Rod Soto to learn how API keys leak out from CI/CD, how they can be found, and how to prevent all this from happening.

 
dmitry_apisec-1  

Dmitry Sotnikov

APIsecurity.io

 
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 Ltd   71-75 Shelton Street  Covent Garden  London  Greater London   WC2H 9JQ   United Kingdom
You received this email because you are subscribed to API Security News from 42Crunch Ltd.

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

Older messages

Issue 96: Vulnerabilities at Cisco and MGM Grand Resort 🏖️, tutorial on Chrome DevTools and pentesting with GraphQL

Thursday, August 13, 2020

Hi, today we look at a couple of API vulnerabilities and two pentesting video tutorials APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #96 Vulnerabilities at

Issue 95: Vulnerabilities at Zoom and OkCupid 💘, progress on OAuth 2.1, API Information Disclosure tutorial

Wednesday, August 5, 2020

Hi, today we look at a couple recent vulnerabilities, a video on locating leaky APIs & APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #95 Vulnerabilities at

Issue 94: Two-day API security training at Black Hat USA 🎩

Wednesday, July 29, 2020

Hi, today we look at the possible API exploit for Wordpress, new stats on WAFs and API APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #94 Two-day API security

Issue 93: Google Sign In flaw in Chingari 📱, a guide to OAuth Authorization Code grant

Thursday, July 23, 2020

Hi, this week we have an OAuth vulnerability, OAuth pentesting guide, Swagger-EZ Burp.. APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #93 Google Sign In flaw in

Issue 92: APIs putting dementia patients at risk ⚕️, OAuth simulators

Friday, July 17, 2020

Hi, today we look at a couple API vulnerabilities, two OAuth2 emulators and a webinar APIsecurity.io The Latest API Security News, Vulnerabilities and Best Practices Issue: #92 APIs putting dementia

You Might Also Like

📧 Unit Testing Clean Architecture Use Cases

Saturday, January 4, 2025

​ Unit Testing Clean Architecture Use Cases Read on: m​y website / Read time: 7 minutes The .NET Weekly is brought to you by: Introducing Depot Cache, the powerful way to make incremental builds up to

iOS Dev Weekly - Issue 693

Friday, January 3, 2025

Happy New Year, and here's to a cracking 2025! 🎊 View on the Web Archives ISSUE 693 January 3rd 2025 Comment Happy New Year, everyone! 🎊 I hope you all had a restful and relaxing break if you took

JSK Daily for Jan 3, 2025

Friday, January 3, 2025

JSK Daily for Jan 3, 2025 View this email in your browser A community curated daily e-mail of JavaScript news Optimizing Productivity: Integrate Salesforce with JavaScript Scheduler Syncfusion

Daily Coding Problem: Problem #1657 [Easy]

Friday, January 3, 2025

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Airbnb. Given a linked list and a positive integer k , rotate the list to the right by k

🍎 How I Use Trackpad Gestures to Manage my Mac — Are You Wearing Your Smartwatch Correctly?

Friday, January 3, 2025

Also: I Used a Temporary eSIM While Traveling and Have Thoughts How-To Geek Logo January 3, 2025 Did You Know There might never have been a Star Wars if not for George Lucas' lead foot and diabetes

SWLW #632: On avoiding pile-ups, The Chief Architect role, and more.

Friday, January 3, 2025

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

Ranked | The World's Top Companies by Revenue in 2024 💵

Friday, January 3, 2025

Walmart, Amazon, and China's State Grid generate over half a trillion dollars in annual revenue, driven by their vast global presence. View Online | Subscribe | Download Our App FEATURED STORY

Issue #574: Web gaming strikes back, Doom Captcha, and Phaser Box2D

Friday, January 3, 2025

View this email in your browser Issue #574 - January 3rd 2025 Weekly newsletter about Web Game Development. If you have anything you want to share with our community please let me know by replying to

Could AI make you a billionaire?

Friday, January 3, 2025

Siri's secret recordings; Is streaming still worth it?; Transform your doodles with AI -- ZDNET ZDNET Tech Today - US January 3, 2025 lm-email-verifaction-tool Could AI make you a billionaire in

⚙️ The grid can't handle AI

Friday, January 3, 2025

Plus: Anthropic's guardrails ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌