DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • API and Security: From IT to Cyber
  • When APIs Go Wrong: Neglecting Rate Limiting
  • Secure Your API With JWT: Kong OpenID Connect
  • API Security: Best Practices and Patterns To Securing APIs

Trending

  • Unlocking Data with Language: Real-World Applications of Text-to-SQL Interfaces
  • Building Custom Tools With Model Context Protocol
  • Build Your First AI Model in Python: A Beginner's Guide (1 of 3)
  • Analyzing Techniques to Provision Access via IDAM Models During Emergency and Disaster Response
  1. DZone
  2. Data Engineering
  3. Databases
  4. API Security Weekly: Issue 173

API Security Weekly: Issue 173

In this latest news update, read about Coinbase vulnerability, AuthN/AuthZ best practices, bad bots, and Elgato Key light hack.

By 
Colin Domoney user avatar
Colin Domoney
DZone Core CORE ·
Aug. 01, 22 · News
Likes (1)
Comment
Save
Tweet
Share
5.0K Views

Join the DZone community and get the full member experience.

Join For Free

This week, we have news of the eye-opening vulnerability on the Coinbase platform which netted $250,000 in bug bounty. There’s also an excellent guide on best practices for authentication and authorization for REST APIs, an article on the growth of bad bots and how to mitigate against them, and a fun read from APIHandyman on how to hack the Elgato Key light API.

Vulnerability: Coinbase API Bug Allowed Unlimited Cryptocurrency Trading

This week’s major news story has been the disclosure of a major vulnerability in an API on Coinbase, a cryptocurrency trading platform. This vulnerability potentially allowed an attacker to make unlimited cryptocurrency trades between different currency accounts.

The vulnerability is a rather epic example of API1:2019 — Broken object-level authorization. To exploit the vulnerability, attackers needed two different cryptocurrency accounts and a modest balance in one account. Attackers could initiate a market order using the account with funds as the source account, but then could modify the API request to specify the other account with a low balance. Unfortunately, the Coinbase validation logic did not verify the source account properly and processed the trade normally. Thus, the attacker could complete the trade using cryptocurrency they did not in fact have.

The security researcher initially took to Twitter to publicize the potential issue to get in contact with the relevant security team at Coinbase. Once alerted, the response from Coinbase was exemplary, resulting in a complete resolution within 6 hours, and earning the security researcher a record $250,000 bounty. Coinbase themselves has covered the issue in their security blog, where they also describe additional compensating controls that would have reduced the impact.

Guide: Best Practices for API Authentication and Authorization

At 42Crunch, we recently featured a webinar focused on API authentication and authorization, an evergreen hot topic for API developers and security teams. This week, we have an excellent concise guide on this topic, courtesy of StackOverflow.

The key takeaways from the guide include the following:

  • Always use TLS: Every API should use TLS (Transport Layer Security) without exception to prevent data leaks. While this introduces complexities in certificate management, modern platforms are moving to integrate certificate solutions to ease adoption.
  • Use OAuth2 for single sign-on (SSO): OAuth2 has established itself as the de facto standard for authorization in SSO, with industry-standard providers like Google, GitHub, Microsoft, etc. By using OAuth2, developers can adopt standard flows for authentication well-designed to avoid common implementation errors, particularly if they also adopt standard OAuth libraries for their language/framework.
  • Use API keys to give existing users programmatic access: For internal users with known identities, API keys can be used to simplify access to APIs without the complexity of OAuth2, as long as the keys are managed securely.
  • Encourage using good secrets management for API keys: Do not commit any API keys to source code repositories — if necessary, use a secrets management solution.
  • Choose when to enforce authorization with request-level authorization: Use authorization middleware to standardize access control and avoid broken function-level authorization vulnerabilities.
  • Configure different permissions for different API keys: Be sure to use granular permissions on API keys to avoid giving unnecessary or unintended access.
  • Leave the rest of the authorization to the app or business logic: If your application has particularly complex authorization requirements, consider using a standard library, such as OSOHq.

The single most important lesson worth repeating here for a developer is to leverage the power of standard libraries and frameworks as much as possible, not re-invent the wheel.

Article: The Rise of Bad Bots and How To Mitigate Against Them

NordicAPIs has contributed an interesting article on the rise of bad bots and how these are impacting APIs.

The article sheds light on how “sneaker bots” (because they automated the online purchase of sneakers on websites) were born, how they evolved to scrape Twitter accounts to gain access to market news a fraction before human users, and how they process this information.

From an adversarial viewpoint, the ability to automate API access facilitates easy attacks and the subsequent exfiltration of data once a vulnerability is discovered. To counteract this, the authors suggest several mitigation strategies against bots:

  • Catch bad actors when they’re still in the reconnaissance stage
  • Establish a baseline for human use of APIs
  • Use an API gateway for rate limiting and to ban requests
  • Have perimeter-level security beyond a gateway
  • Avoid misconfigured APIs
  • Make sure your authentication controls are up to scratch and limit access to potentially sensitive data wherever possible.

Article: How To Reverse Engineer and Hack the Elgato Key Light API

As a little self-indulgence (I’m an owner of an Elgato Key light) this week, we have a great write-up from the APIHandyman on hacking the Key light internal API. The article describes how to use the proxy feature in Postman to capture requests from the Elgato desktop application to the Key light. The author then demonstrates how the API can be enumerated using standard light operations.

Finally, the author makes some observations on the quality of the API design including:

  • Values for light on/off were non-human readable values, prefer the use of “on” and “off”
  • The brightness value did not seem to validate a minimum value, instead allowing zero as a valid value.
  • For brightness values out of range (like 110%), a HTTP 200 OK code was returned rather than an error code as might be expected.
  • The color temperate values did not map to the Kelvin values on the UI, meaning that the user had to guess how the Kelvin value was derived internally.

All in all, a fun write-up showing some great Postman techniques and API design tips.

API authentication security

Published at DZone with permission of Colin Domoney. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • API and Security: From IT to Cyber
  • When APIs Go Wrong: Neglecting Rate Limiting
  • Secure Your API With JWT: Kong OpenID Connect
  • API Security: Best Practices and Patterns To Securing APIs

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!