Issue 145: APIs and electric car charging stations, The Nuts and Bolts of OAuth 2.0 🔩

The Latest API Security News, Vulnerabilities and Best Practices
Issue: #145
APIs and electric car charging stations, The Nuts and Bolts of OAuth 2.0
This week, we take a look at the recently discovered (and fixed) API vulnerabilities in electric car charging stations, a Udemy course on OAuth 2.0, the recently released Gartner Hype Cycle on APIs, and how APIs in microservices architectures can be exploited if they construct backend calls without properly validating inputs.
Vulnerability: Electric vehicle charging stations
 

Researchers at Pen Test Partners looked into the security of several popular smart charging stations for electric vehicles.

The chargers are typically controlled through a cloud platform and a mobile app, and hence have APIs that can be accessed remotely and can be vulnerable.

The potential exploits that Pen Test Partners found were threefold:

  • Attackers might be able to retrieve users’ personal details.
  • Attackers might be able to control the charging process for an individual car.
  • Attackers might be able to mass-control all charging stations in a country or region and use them to cause massive spikes of power consumption, affecting the national power grid.

Here are some API vulnerabilities that they found:

  • Project EV / ATESS / Shenzen Growatt (the largest platform that they looked at with over 2.9 million devices):
    • The API call for login (POST on /ocpp/user) did not actually need a password and would let anyone in if they simply supplied the username or the serial number of the charger!
    • The serial numbers were predictable and easy to enumerate (TTD0xxxxx).
    • Starting or stopping a charger was a matter of sending the corresponding lock/unlock command to the /ocpp/api endpoint:
      POST /ocpp/api/ HTTP/1.1
      Content-Type: application/json;charset=UTF-8
      Content-Length: 64
      User-Agent: Dalvik/2.1.0 (Linux; U; Android 9; Redmi 8A MIUI/V11.0.3.0.PCPMIXM)
      Host: charge[.]growatt[.]com
      Connection: close
      Accept-Encoding: gzip, deflate

      {"chargeId":"TTD0xxxxx","connectorId":1,"lan":1,"cmd":"lock"}
  • Wallbox had Broken Object-Level Authorization (BOLA/IDOR) issues, meaning that the attacker could log in with their account but then use device IDs belonging to other customers to take over their chargers:
    Wallbox-ev-ch-4
  • EVBox had an API flaw that allowed unprivileged accounts to be escalated as administrators through what seems to have been a mass assignment vulnerability. In a profile update call, a user could add additional roles (possible values discoverable through error messages) as the roles array, and the backend just applied the requested change. By adding the tenant admin role to their user, attackers could take over  all charging stations in that tenant:
    PATCH /api/users/profiles/00uascl0k2XXZXT8w416 HTTP/1.1
    Host: api[.]everon[.]io
    Accept: application/json, text/plain, */*

    {"profile":{"firstName":"egw",
    "roles":["ADMIN","ACCOUNT_OWNER", "tenantadmin"]
    }}
  • Chargepoint, a charging infrastructure provider with about 150,000 stations globally, had a GraphQL endpoint that allowed introspection, thus exposing customer database details. The researchers didn’t retrieve or manipulate any data as they assumed this was a production system with real customer information.
    Chargepoint_ev-ch-1-1

All vendors have since fixed the vulnerabilities, but the magnitude of what could potentially have been achieved through them is quite chilling here.

Lessons learned:

  • In the world of the Internet of Things (IoT), API security — or the lack of it — can have significant privacy, personal, and even national security consequences.
  • Authentication, authorization, and data validation are all extremely important and serve as the foundation of API security.
  • If using GraphQL, learn more about its security and don’t just go with the defaults.
Training: The Nuts and Bolts of OAuth 2.0
 

Learn OAuth from one of its creators! Aaron Parecki has released his “The Nuts and Bolts of OAuth 2.0” class on Udemy that covers:

  • OAuth 2.0
  • OpenID
  • PKCE
  • Deprecated flows
  • JSON web tokens (JWTs)
  • API gateways
  • Scopes

No programming knowledge is needed. Here’s a 5-minute intro video:

OAuth_course_preview

 

Analysts: Gartner Hype Cycle on APIs
 

Gartner Hype Cycles offer nice visual representations of where the technologies are in terms of their hype, maturity, and adoption.

Mark O’Neill and John Santoro have just released their “Hype Cycle for APIs and Business Ecosystems, 2021” report. As the chart below shows, API security testing is sharply on the rise (as are Graph APIs), API threat protection is still near the top but further along the maturity route.

See the full report (behind a paywall) for more details on the technologies mentioned.

Gartner_Hype_Cycle_for_APIs_2021

 

Video: Traversing My Way in the Internal Network
 

A huge number of APIs these days are APIs exposed by microservice-based applications. This means that the APIs exposed by an app are implemented as microservices that receive your call and likely make their own API calls to other, more back-end microservices in the system.

For example, a call to api/v1/user?id=1337 might mean that this microservice is making its call to some_internal_domain/users/1337.

That backend likely blindly trusts the frontend microservice, and if there is no data validation in place, an attacker may be able to get to other parts of the system by manipulating the parameters in the API call. For example, calling api/v1/user?id=1337/../../ might get translated to some_internal_domain/users/1337/../../ and thus normalized to some_internal_domain/, getting to the root of the backend.

Watch this recording of a talk by Jasmin Landry at a recent OWASP event in which he covers the traversal attacks that can come out of microservices architecture. He discusses various variants of potentially dangerous API inputs (query parameters, path parameters, JSON payloads), as well as his real-life experience in finding and reporting such vulnerabilities:

API_traversal_attacks_preview

 

Lessons learned from this one:

  • Zero trust approach and diligent data validation are really important. Define and enforce all your API inputs (parameters and payloads) as well as outputs in all your API definitions.
  • Validate and enforce all allowed paths and operations.
 
Dmitry - transparent circle

 

 

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, 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 144: JustDial API vulnerability re-emerges, API key checker, the state of OAuth

Thursday, July 29, 2021

Hi, this week we have great videos on OAuth roadmap and GraphQL attacks and defenses. There's also an API key validator script and a story of APIsecurity.io The Latest API Security News,

Issue 143: GraphQL API leaking credit cards, SQLi in JWT, XML attacks mind map 🗺️

Thursday, July 22, 2021

Hi, today we have a case study of an API leaking credit card numbers, a lab on SQL injections in JWT, an API Security CTF, and a mind map of APIsecurity.io The Latest API Security News, Vulnerabilities

Issue 142: API vulnerabilities in Coursera and Huawei, GraphQL rate limiting and discovery 🔎

Friday, July 16, 2021

Hi, this week we look at the recent vulnerabilities in Coursera & Huawei, and discuss rate-limiting best practices for GraphQL as well as new APIsecurity.io The Latest API Security News,

Issue 141: API vulnerabilities in VeryFitPro and Gettr, AWS Lambda authorizers, AsyncAPI 2.1 🏅

Saturday, July 10, 2021

Hi, today we have a few recent API vulnerability case studies, a research on possible implementation flaws in AWS Lambda Authorizers, and the APIsecurity.io The Latest API Security News,

Issue 140: API vulnerabilities at LazyPay, Western Digital, and LinkedIn; IDOR mindmap 🗺️

Thursday, July 1, 2021

Hi, today we look at LinkedIn data getting scraped and WD NAS devices wiped, the recent LazyPay API flaw and an IDOR/BOLA pentesting mindmap APIsecurity.io The Latest API Security News, Vulnerabilities

You Might Also Like

Daily Coding Problem: Problem #1648 [Medium]

Wednesday, December 25, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Quora. Given an absolute pathname that may have . or .. as part of it, return the

🎮 The Best Games to Go With Your New Console — Streaming Services Could Learn From YouTube

Wednesday, December 25, 2024

Also: Don't Throw Christmas Gift Boxes on the Curb, and More! How-To Geek Logo December 25, 2024 Did You Know Years before The Nightmare Before Christmas, Tim Burton was sprinkling references to

Charted | Global Economic Confidence in 2025, by Country 🌎

Wednesday, December 25, 2024

While emerging markets in Asia have the strongest confidence in the global economy looking ahead, European countries are most pessimistic. View Online | Subscribe | Download Our App FEATURED STORY

Top Tech Deals 🎅 Sony Headphones, iPhone Cases, 4K Projector, and More!

Wednesday, December 25, 2024

The season of giving is upon us. How-To Geek Logo December 25, 2024 Top Tech Deals: Sony Headphones, iPhone Cases, 4K Projector, and More! The season of giving is upon us. Happy Holidays! If you're

Why the Race to AGI is Humanitys Defining Moment

Wednesday, December 25, 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 25, 2024? The

Iran's Charming Kitten Deploys BellaCPP: A New C++ Variant of BellaCiao Malware

Wednesday, December 25, 2024

THN Daily Updates Newsletter cover The Data Science Handbook, 2nd Edition ($60.00 Value) FREE for a Limited Time Practical, accessible guide to becoming a data scientist, updated to include the latest

Software Testing Weekly - Issue 251

Wednesday, December 25, 2024

GitHub Copilot is free! 🤖 View on the Web Archives ISSUE 251 December 25th 2024 COMMENT Welcome to the 251st issue! In case you missed it — GitHub Copilot is free! The free version works with Visual

Daily Coding Problem: Problem #1647 [Medium]

Tuesday, December 24, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Square. In front of you is a row of N coins, with values v 1 , v 1 , ..., v n . You are

Sentiment Analysis, Topological Sort, Web Security, and More

Tuesday, December 24, 2024

Exploring Modern Sentiment Analysis Approaches in Python #661 – DECEMBER 24, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Exploring Modern Sentiment Analysis Approaches in Python What are the

🤫 Do Not Disturb Mode Is My Secret to Sanity — 8 Gadgets I Want To See Nintendo Make

Tuesday, December 24, 2024

Also: The Best Christmas Movies to Watch on Netflix, and More! How-To Geek Logo December 24, 2024 Did You Know Their association with the Christmas season might make you think poinsettias hail from a