FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

security: externalize hardcoded SDK secrets, harden WebView, patch gson CVE by devin-ai-integration[bot] · Pull Request #2 · nozuonodial/AndroidProject · GitHub

security: externalize hardcoded SDK secrets, harden WebView, patch gson CVE - #2

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1783992835-security-fixes
Open

security: externalize hardcoded SDK secrets, harden WebView, patch gson CVE#2
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1783992835-security-fixes

Conversation

Copy link
Copy Markdown

Summary

Fixes the three critical issues found in a security scan of the codebase. Scoped to non-breaking changes so CI (./gradlew build aR) still passes.

1. Hardcoded third-party secrets removed from version control (configs.gradle)

The Umeng AppKey and, more importantly, the QQ / WeChat AppSecret values were committed in plaintext. AppSecrets are server-side credentials that should never ship in a client repo. They are now loaded from an untracked keys.properties:

def keysFile = rootProject.file("keys.properties")
def keys = new Properties()
if (keysFile.exists()) { keysFile.withInputStream { keys.load(it) } }
QQ_APP_SECRET = keys.getProperty("QQ_APP_SECRET", "")   // was "9dfd33...", now read from untracked file
// ...same for UMENG_APP_KEY, QQ_APP_ID, WX_APP_ID, WX_APP_SECRET
  • keys.properties added to .gitignore
  • keys.properties.template added documenting the keys to configure locally
  • Missing keys fall back to "", so the build still configures without the file (e.g. in CI)

2. WebView hardening (widget/BrowserView.java)

  • setAllowFileAccess(false) + explicitly disable AllowFileAccessFromFileURLs / AllowUniversalAccessFromFileURLs — prevents malicious pages reading app-private files
  • MIXED_CONTENT_ALWAYS_ALLOW → MIXED_CONTENT_COMPATIBILITY_MODE
  • SSL cert errors: the old handler let the user tap through an invalid TLS cert (MITM risk, flagged by Google Play). Now release builds reject automatically; the manual prompt is kept only for debug builds:
if (!AppConfig.isDebug()) { handler.cancel(); return; }
// debug-only: show dialog to proceed/cancel

3. Dependency CVE (app/build.gradle)

com.google.code.gson:gson 2.8.8 → 2.8.9, fixing CVE-2022-25647 (deserialization DoS).

Other findings (reported, not changed here)

  • Signing keystore + password committed (app/AppSignature.jks, app/gradle.properties with StorePassword=AndroidProject). Left as-is because CI's assembleRelease depends on it and it is an intentional throwaway demo key — recommend rotating and externalizing for real projects.
  • App-wide cleartext traffic enabled (usesCleartextTraffic="true" + permissive network_security_config.xml) and a demo HTTP video URL — acceptable for a demo template, should be tightened per-domain for production.
  • No SQL injection / raw SQL (app uses MMKV + typed HTTP APIs, no SQLite), no CORS/server endpoints (client-only app), and exported components (WXEntryActivity, FileProvider) are correctly configured.

Link to Devin session: https://app.devin.ai/sessions/2c28a8afb17245e0b0f6abe5ccf13245
Requested by: @nozuonodial

…on CVE

- Move UMENG/QQ/WeChat AppKey & AppSecret out of configs.gradle into an
  untracked keys.properties (with template + .gitignore entry) instead of
  hardcoding them in version control
- Harden BrowserView WebView: disable local file access, drop
  MIXED_CONTENT_ALWAYS_ALLOW to COMPATIBILITY_MODE, and reject SSL cert
  errors in release builds (was allowing users to bypass via dialog)
- Bump gson 2.8.8 -> 2.8.9 to fix CVE-2022-25647

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
nozuonodial self-assigned this Jul 14, 2026

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL