# CVE-2012-6636: Code injection in n/a

> Remote attackers can execute arbitrary Java methods via crafted JavaScript in WebView components on Android API levels 16 and earlier.

- **Severity:** Medium 6.8 (`AV:N/AC:M/Au:N/C:P/I:P/A:P`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 3 Mar 2014
- **Updated:** 6 Aug 2024
- **Also known as:** GHSA-9qcw-937q-52w8, UBUNTU-CVE-2012-6636

## What is CVE-2012-6636?

CVE-2012-6636 is a medium-severity code injection vulnerability in n/a, published on 3 Mar 2014. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

The Android API before 17 does not properly restrict the WebView.addJavascriptInterface method, which allows remote attackers to execute arbitrary methods of Java objects by using the Java Reflection API within crafted JavaScript code that is loaded into the WebView component in an application targeted to API level 16 or earlier, a related issue to CVE-2013-4710.

Weakness: CWE-264

## Which versions are affected by CVE-2012-6636?

It affects 1 product.


Products: Google Android Api.

## How do I fix CVE-2012-6636?

No fix has been published for CVE-2012-6636 yet. Limit exposure of the affected software until one is available.

## Is CVE-2012-6636 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2012-6636 exists.

Public exploit code:

- An app demo for test android webview security issue: CVE-2012-6636 (github_poc): https://github.com/xckevin/AndroidWebviewInjectDemo
- Android 3.0 through 4.1.x on Disney Mobile, eAccess, KDDI, NTT DOCOMO, SoftBank, and other devices does not properly implement the WebView class, which allows remote attackers to execute arbitrary methods of Java objects or cause a denial of service (reboot) via a crafted web page, as demonstrated by use of the WebView.addJavascriptInterface method, a related issue to CVE-2012-6636. (github_poc): https://github.com/Snip3R69/CVE-2013-4710-WebView-RCE-Vulnerability
- Google Android 4.2 Browser and WebView - 'addJavascriptInterface' Code Execution (Metasploit) (exploitdb)
- Android Browser and WebView addJavascriptInterface Code Execution (metasploit)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2012-6636 and fix it if it is affected.

What it is: CVE-2012-6636 is a medium-severity code injection vulnerability in n/a, published on 3 Mar 2014. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2012-6636 exists.

Affected product: n/a. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2012-6636/ (Markdown: https://insights.sbomify.com/CVE-2012-6636/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2012-6636
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2012-6636
- OSV: https://osv.dev/vulnerability/CVE-2012-6636

---
From sbomify Insights: https://insights.sbomify.com/CVE-2012-6636/
Summaries are generated and may contain mistakes; the official description above is the record.
