noway - PUBLIC
  • DOCS FOR THINGS
  • _ref
    • Working Memory
    • NASA’s 10 rules for writing mission-critical code
    • React Native
  • _docs
    • Cryptography
    • Store APIs Key in FrontEnd SDK issues
    • APIs abuse issues
    • Webpack
    • Specific things
      • Text recognition
    • Book reviews
      • April 2020
      • 1-2/2020
      • March 2020
    • Visualization
    • MacOS
    • Go
    • Server
      • Easy way to setup a local HTTP Server on macOS
    • React
    • Reading
    • Tips
      • MVP
      • Sleeping in the right way
      • Get more things done
    • VS Code
      • Intelligent doesn't auto complete the JSX attribute or react-native components
      • Setting.json
    • Service Registration
      • Apple Enterprise Developer Account
    • DevOps
      • Using NGINX for ReactJS
    • Firebase
      • Upload image
      • Save data
      • Save Data with unique key
      • Setup local firebase functions
    • Documentation
      • API Documentation
    • React Native
      • Tips
      • Performance
      • Patterns in React
      • Rendering in React
      • View JS from apk
      • Flatlist with large data list causes blank view
      • Facebook SDK
      • Screen Events
      • Hotkeys
      • Deep Links
        • iOS Deep Link: Universal Link vs URL Schemes‌
        • Deferred Link‌
      • Text going off screen with flexDirection: 'row'
  • _posts
    • 2020-07-13-How-to-Understand-things
    • 2019-02-20-how-to-create-Jekyll-blog-with-github-page
    • 2019-03-01-books-02-19
    • 2019-02-11-highlight-the-pragmatic-programmer-part-01
    • 2019-02-15-highlight-the-pragmatic-programmer-part-03
    • 2019-02-14-highlight-the-pragmatic-programmer-part-02
    • 2019-04-11-books-03-19
    • 2019-03-07-telegram-bot-as-a-real-time-logger
    • 2019-02-04-generic-loading-ios
    • 2019-01-31-summary-books-01-19
    • 2019-03-27-short-polling-with-Swift
    • 2019-02-22-try-catch-exception-rather-than-return-codes
    • 2019-09-29-api-docs
  • category-archive
  • tag-archive
Powered by GitBook
On this page
  • I. Context
  • II. Issues
  • III. Wrap Solutions
  • Separate Android/iOS and web APIs
  • System
  • Restrict usage on Web, Android and iOS app
  • Using JWT as short-live token
  • Conclusion

Was this helpful?

  1. _docs

APIs abuse issues

I. Context

In this post, I will just mention to abusing issues

We're providing services which fee base on request numbers. The services run on web, iOS, and Android platforms.

II. Issues

What attacker can:

  • Abuse sms api to many phone -> customer can lost money

  • Abuse sms api to phone -> annoy users

  • Use the service key for attacker's service -> customer can lost money

Why

  • Attackers want to attack customers

  • Attackers want to attack us.

The issues come from platforms:

  • Easy to catching the request and keys on browsers -> attackers can capture and simulate requests

  • Can't restrict by domain or while list IP on mobiles -> attackers can capture and simulate requests

  • Leak secret_key/APIs key on mobile -> attackers can use it for other services. For example: using for web services

  • Don't know requests come from trusty apps or not

III. Wrap Solutions

Separate Android/iOS and web APIs

Build 3 APIs flows so attackers can't use hacked from a platform to another platform, especially from mobile to web

System

  • Limit APIs request rate by IP

  • Prevent by country IP

  • Alert

Restrict usage on Web, Android and iOS app

  • Web: limit by domain

  • Android: add package name and SHA-1signing-certificate fingerprint/app ID to restrict usage to Android app

  • iOS: accept requests from the iOS app with the bundle identifier that supply

Using JWT as short-live token

Using JWT with cryptography signature created from app for request

  • The signature cryptography algorithm is created from .so in Android, and .framework in iOS to prevent reverse engineering

  • The signature can be gen in the customer's backend

Conclusion

In mobile app can do

Layer 1

  • Using JWT from file config

  • Restrict by App ID

Layer 2

  • Prebuild JWT in mobile to c++ lib

PreviousStore APIs Key in FrontEnd SDK issuesNextWebpack

Last updated 5 years ago

Was this helpful?

Verification and two-factor authentication best practices
Protect Your Verify Application with Service Rate Limits
Anti-Fraud Developer’s Guide
Logo
Logo
Logo