How we found 24 Android vulnerabilities using our open source AI security agent
This analysis explores the AI-driven taskflows used to uncover 24 Android vulnerabilities, including specific examples like location tracking in OsmAnd and account takeover in the Wikipedia app. It also provides guidance on deploying the open-source agent for vulnerability detection.
Introduction to AI-Driven Security Taskflows
The integration of AI into security research has enabled more efficient and scalable vulnerability discovery. The GitHub Security Lab Taskflow Agent is an open-source tool that allows researchers to automate and share AI prompts and workflows tailored for specific security tasks. This approach is particularly effective in identifying complex vulnerabilities that may be missed by traditional methods.
Targeted Taskflows for Android Vulnerability Detection
Android applications present unique security challenges due to their reliance on components like activities, intents, and deep links. To address these, the taskflows were designed to focus on mobile-specific vulnerabilities. For example, the gather_mobile_entry_point_info.yaml taskflow identifies entry points that could be exploited by external components, such as exported activities that accept intent extras. This helps narrow the attack surface and ensures the AI focuses on relevant areas of the codebase.
Another taskflow, classify_application_local.yaml, guides the AI to check for specific vulnerability classes, such as insecure broadcasts or confused deputy issues, which are common in Android apps. By combining strict prompts with broader, more exploratory prompts, the AI can both systematically identify known vulnerabilities and creatively uncover new ones.
Case Study: Location Tracking in OsmAnd
One of the vulnerabilities discovered was in the OsmAnd app, a popular navigation tool. The app's MapActivity was found to be exported and allowed intent extras that could be manipulated by any external app. This enabled malicious actors to import settings without user notification, including replacing map tiles with URLs controlled by an attacker. This change allowed the attacker to track the user's location by analyzing the tile coordinates accessed by the app.
Case Study: Wikipedia Account Takeover via Deeplink
The Wikipedia Android app was found to have a logic bug in its hostname parser, which allowed attackers to use a wikipedia:// deeplink to load non-Wikipedia URLs. This vulnerability, combined with a flaw in cookie management, enabled an attacker to trick users into visiting a malicious page that appeared to be part of Wikipedia. The app then sent the user's cookies to the attacker's server, resulting in a full account takeover.
How to Deploy the Taskflows
The taskflows are open source and can be run using a GitHub Codespace. To get started, users can clone the seclab-taskflows repository and run the run_mobile.sh script. This process may take several hours depending on the size of the repository. Once complete, the results are stored in an SQLite database, and vulnerabilities can be identified by checking the has_vulnerability column in the audit_results table.
Considerations and Limitations
While the AI-driven taskflows are powerful, they are not without limitations. The use of premium models and the high token consumption of the taskflows can make them resource-intensive. Additionally, the effectiveness of the taskflows depends on the quality of the prompts and the ability of the AI to interpret the context of the code correctly. Researchers should also be aware that the AI may not always detect all types of vulnerabilities, especially those that are highly context-dependent or require deep domain knowledge.
Despite these limitations, the taskflows provide a valuable tool for automating the discovery of Android vulnerabilities. By combining targeted prompts with AI's ability to explore code creatively, researchers can uncover critical security issues that might otherwise go unnoticed.
Source: GitHub Blog. Analysis based on publicly available information; no hands-on testing is claimed.