OWASP Security Testing for Web API and Android Source Code

Security testing Android applications that consume web APIs requires a dual-lens approach: the mobile client and the server-side API surface must be evaluated in concert. OWASP provides the structural standards—ASVS for verification, the API Security Top 10 for API-specific risks, the Mobile Top 10 for Android client threats, and the API Security Testing Framework (ASTF) for structured test execution [1][3][4][6]. This article maps these standards to concrete testing activities across both tiers.
Why Split Testing Matters for Android-API Architectures
Android applications rarely operate in isolation. They authenticate against identity providers, fetch data from REST or GraphQL endpoints, and often cache sensitive payloads locally. A vulnerability on either side—broken object-level authorization in the API or insecure local storage on the device—can compromise the entire chain. Testing only the API ignores client-side data leakage; testing only the Android APK ignores business logic flaws that only manifest through sequenced API calls. The OWASP Top Ten remains the foundational risk catalog for the web layer [1], but API-specific and mobile-specific extensions are necessary because neither traditional web fuzzing nor standard SAST profiles cover the full attack surface [4][6]. Practitioners need a structured methodology that addresses both tiers without duplicating effort or creating gaps.
OWASP ASVS: Setting Verification Baselines
The OWASP Application Security Verification Standard (ASVS) defines technical security controls that map directly to code-level and test-level activities [3]. For Android-API systems, ASVS provides the baseline requirements that both the API and the client must satisfy before dynamic testing begins. Relevant ASVS categories include authentication verification (session management, token handling), authorization verification (horizontal and vertical access controls), input validation, and cryptography. In practice, this means the API must enforce token expiration, scope validation, and rate limiting at the gateway or middleware layer, while the Android client must store tokens in hardware-backed keystores rather than shared preferences. ASVS levels (1 through 3) let teams calibrate depth: Level 1 for baseline hardening, Level 2 for most commercial applications, and Level 3 for high-assurance environments. Aligning SAST rules to ASVS requirements ensures that static analysis catches misconfigurations—such as weak cipher suites or missing authorization checks—before a single dynamic test runs [3][5].
Mapping the OWASP API Security Top 10 to Test Cases
The OWASP API Security Top 10 addresses risks that do not behave like traditional web application flaws [6]. APIs lack UI-based protections, rely heavily on programmatic access, and expose structured data that demands strict authorization modeling. Each item in the API Top 10 translates to specific test cases that should be executed against the endpoints an Android app consumes. The following table maps the most critical API risks to concrete testing actions.
| API Risk | Testing Action | Tool Category |
|---|---|---|
| BOLA (Broken Object-Level Authorization) | Iterate object IDs in GET/PUT/DELETE requests for each authenticated user; verify cross-tenant isolation | DAST / Custom scripts |
| Broken Authentication | Test token forgery, expiration bypass, credential stuffing against auth endpoints | DAST / Fuzzing |
| Broken Object Property Level Authorization | Manipulate JSON fields in PUT/PATCH requests to escalate privileges or access restricted attributes | DAST / Manual |
| Unrestricted Resource Consumption | Send large payloads, deep pagination queries, and concurrent requests to trigger DoS or cost exhaustion | Load testing / DAST |
| Security Misconfiguration | Enumerate exposed debug endpoints, default credentials, overly permissive CORS, and missing rate limits | Recon / DAST |
BOLA remains the most prevalent API vulnerability in real-world assessments [6]. For Android apps, BOLA testing must replicate the exact request sequences the client performs—including custom headers, interceptor chains, and authentication token formats—because APIs often validate these client-specific signatures. Using a proxy like mitmproxy to capture and replay traffic from a rooted or debuggable APK ensures tests reflect actual client behavior rather than synthetic requests that may bypass API-side client fingerprinting.
OWASP ASTF: Structuring the API Test Execution
The OWASP API Security Testing Framework (ASTF) provides a systematic methodology for identifying security vulnerabilities in APIs [4]. Rather than ad-hoc fuzzing, ASTF organizes tests into phases: reconnaissance, configuration testing, authentication testing, authorization testing, input validation testing, and rate limiting testing. Each phase produces documented evidence tied back to the API Security Top 10. For Android-API testing, ASTF is most effective when applied to captured API traffic. The workflow begins by instrumenting the Android application to route traffic through a testing proxy, logging all endpoints, methods, parameters, and headers. This traffic profile becomes the input to ASTF’s reconnaissance phase. The framework then guides testers through authorization matrices—systematically substituting user contexts, object identifiers, and property sets to uncover BOLA and BFLA (Broken Function-Level Authorization) flaws. ASTF’s structured output aligns well with compliance evidence requirements, as each test case maps to a specific risk category and produces a pass/fail result with supporting request-response pairs [4].
Android Source Code Testing: Mobile-Specific OWASP Controls
While the API side follows ASTF and ASVS, the Android source code requires a separate testing track aligned with mobile-specific threats. Key areas include insecure data storage (checking for plaintext credentials in SQLite databases, shared preferences, or log files), insecure communication (validating TLS configuration, certificate pinning implementation, and cleartext traffic restrictions in the manifest), and component exposure (testing whether exported activities, services, broadcast receivers, or content providers enforce proper permission checks). SAST tools configured with Android-specific rules should scan the Java/Kotlin source and the compiled APK. Critical rule categories include detection of hardcoded API keys or tokens, use of deprecated cryptographic algorithms, improper use of Android Keystore (such as storing encryption keys outside hardware-backed storage), and WebView misconfigurations that enable JavaScript injection. Dynamic testing on the device complements SAST by verifying runtime behavior: Frida or Xposed hooks can intercept method calls to confirm that certificate pinning is active, that biometric authentication cannot be bypassed, and that sensitive data is encrypted before being written to disk.
Identity and Token Handling Across Client and API
Identity is the seam between Android client and web API, and it is where many architectures fail. OAuth 2.0 and OpenID Connect flows implemented in Android apps must be tested end-to-end: from the authorization request through token issuance, refresh, and revocation. Common flaws include storing refresh tokens in non-encrypted local storage, failing to validate token audience claims on the API side, accepting expired access tokens, and implementing custom token refresh logic that introduces race conditions. ASVS authentication requirements mandate that tokens are bound to the client—typically via PKCE for public clients like mobile apps—and that the API server validates all relevant claims before processing requests [3]. Testing should verify that token theft from the device (via rooted access or backup extraction) does not allow indefinite API access, that token revocation propagates within acceptable timeframes, and that multi-factor authentication challenges cannot be skipped by manipulating API request parameters. The emerging intersection of AI-assisted vulnerability discovery compresses exploit timelines significantly [2], making robust identity controls a latency-critical defense rather than a nice-to-have.
Integrating OWASP Testing into DevSecOps Pipelines
Manual OWASP-guided testing is necessary for deep authorization logic, but scaling it across continuous delivery requires automation. A practical DevSecOps integration layers multiple test types at different pipeline stages. Pre-commit hooks and IDE plugins run lightweight SAST rules focused on high-confidence findings—hardcoded secrets, known vulnerable library versions, and insecure API configurations. Build-stage SAST performs full OWASP ASVS-aligned analysis on both the Android source and the API codebase, producing SARIF reports that integrate with developer workflow tools. Post-deploy DAST executes ASTF-derived test suites against staging environments, using API schemas (OpenAPI/Swagger) as input for automated endpoint discovery. For Android-specific dynamic tests, CI pipelines can run instrumentation tests on emulators with Frida scripts attached, automating checks for certificate pinning, secure storage, and component exposure. The key principle is shift-left with depth: catch configuration and implementation errors early with SAST, reserve expensive authorization and business logic testing for environments that closely mirror production. Compliance frameworks increasingly expect this layered approach [5], and aligning tool output to ASVS and ASTF categories simplifies audit evidence collection.
AI-Driven Threats and Compressed Exploit Timelines
The threat landscape for API-driven mobile applications is shifting rapidly. AI-assisted vulnerability discovery tools can now identify and chain API flaws—such as combining BOLA with information disclosure to achieve account takeover—in timeframes that were previously impractical for human testers [2]. A joint emergency strategy briefing from SANS Institute, Cloud Security Alliance, and OWASP highlighted that exploit timelines have compressed from weeks to hours in scenarios where AI tools are applied against inadequately tested API surfaces [2]. For Android-API systems, this means that the traditional model of annual penetration tests is insufficient. Continuous security testing, automated regression suites derived from OWASP ASTF test cases, and real-time API monitoring for anomalous access patterns become baseline requirements. The 13-item risk register published in that briefing maps directly to OWASP’s AI-specific top-ten lists (LLM Top 10 2025, Agentic Top 10 2026) [2], signaling that AI components embedded in either the Android client or the API backend introduce additional testing dimensions—prompt injection, training data extraction, and adversarial input manipulation—that standard OWASP mobile and API checklists do not yet fully cover.
Quantitative Benchmarks for OWASP-Compliant API Testing
To measure the maturity of an OWASP-aligned testing program for Android-API systems, teams should track the following metrics across sprint cycles and release candidates. These benchmarks provide evidence for both internal risk management and external compliance audits.
- ASVS coverage ratio: Percentage of applicable ASVS requirements (at the selected level) covered by automated SAST rules and manual test procedures. Target: 90%+ at Level 2 for production systems.
- ASTF phase completion rate: Percentage of ASTF testing phases (reconnaissance through rate limiting) executed per API release. Target: 100% for APIs handling PII or financial data.
- API Top 10 test density: Number of distinct test cases mapped to each OWASP API Security Top 10 category. Target: minimum 5 test cases per category for critical APIs.
- Android Mobile Top 10 coverage: Percentage of OWASP Mobile Top 10 risks addressed by combined SAST and dynamic testing. Target: 100% for release-blocking severity findings.
- Mean time to remediate (MTTR) by severity: Critical findings from OWASP-aligned tests should be remediated within 48 hours; high within one sprint; medium within two sprints.
- False positive rate: SAST and DAST tools tuned to OWASP rulesets should maintain below 15% false positive rates to prevent alert fatigue and tool distrust.
Common Gaps in Android-API Security Testing Programs
Despite the availability of OWASP frameworks, several recurring gaps undermine testing effectiveness. First, teams often test the API in isolation using synthetic clients, missing client-specific behaviors such as custom authentication headers, request signing, or sequential call dependencies that the Android app enforces. Second, Android testing frequently stops at SAST without dynamic validation on a real device or emulator, leaving runtime flaws like insecure IPC or bypassed certificate pinning undetected. Third, authorization testing is often limited to positive-path verification—confirming that an admin can access admin resources—without systematically testing negative paths where a regular user attempts to access admin endpoints or another user’s resources. Fourth, API versioning introduces drift: when the API is updated but the Android client lags behind, older API versions may lack security controls present in newer versions, yet they remain active and untested. Finally, third-party SDKs embedded in the Android app often introduce their own API communication channels that bypass the app’s primary security controls—these shadow APIs are rarely included in ASTF scoping.
FAQ
What is the difference between OWASP ASVS and ASTF?
ASVS (Application Security Verification Standard) defines what security controls an application must implement—it is a requirements checklist. ASTF (API Security Testing Framework) defines how to test whether those controls are working—it is a testing methodology. ASVS answers “what should be secure?” and ASTF answers “how do I verify it?” [3][4].
Can I use the same SAST tool for both Android and API source code?
Many enterprise SAST platforms support both Java/Kotlin (Android) and backend languages (Java, Python, Go, Node.js), but rule packs must be configured separately. Android-specific rules target mobile APIs (Keystore, WebView, ContentProvider), while API rules target web frameworks (Spring, Express, Django). Using a single tool with dual configuration is efficient, but ensure both rule sets are active and mapped to the relevant OWASP top-ten categories.
How does BOLA testing differ for Android-consumed APIs versus web-consumed APIs?
The core technique—substituting object identifiers across user contexts—is identical. The difference lies in request construction: Android apps often add custom headers (device IDs, client versions, request signatures), use different authentication flows (PKCE-based OAuth), and make sequenced calls where earlier responses determine later request parameters. BOLA testing for Android APIs must replicate these exact request characteristics, otherwise the API may reject or handle the request differently than it would for legitimate client traffic.
How frequently should OWASP API and Android security testing run?
SAST should run on every commit or at minimum every pull request. ASTF-aligned DAST should run against staging environments on every API release candidate. Full manual OWASP-guided penetration testing—including deep authorization logic, business logic abuse, and Android dynamic analysis—should occur at least quarterly for critical applications, or whenever significant architectural changes are introduced. AI-driven threat compression makes quarterly the absolute minimum for manual testing [2].
Sources
[1] OWASP Top Ten Web Application Security Risks — OWASP Foundation
[2] SANS Institute, Cloud Security Alliance, [un]prompted, and OWASP Emergency Strategy Briefing — Cloud Security Alliance
[3] Application Security Standards Guide: 2026 Best Practices — SentinelOne
[4] OWASP API Security Testing Framework — Overview — OWASP (GitHub)
[5] Application Security Frameworks and Standards: OWASP, NIST, ISO — Wiz
[6] OWASP API Security Top 10 — Practical DevSecOps