Debug builds log full plugin methodData (incl. credentials) to logcat

Aperta
#8,652 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
android, java, javascript, typescript
Ambito
mobile, security

Direzione di ricerca

Start in Bridge.java at callPluginMethod (around lines 832-843), where Logger.verbose prints call.getData(), then check how Logger gates output via CapConfig.loggingBehavior. The JS mirror is createLogFromNative/createLogToNative in native-bridge.js. Done means the redaction approach is agreed with maintainers, and secret-looking keys or oversized payloads no longer print verbatim in either layer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

triage

Problem: in debuggable builds, the native bridge logs every plugin call's full payload. Bridge.java (callPluginMethod, ~832-843) does Logger.verbose("callback: ... methodData: " + call.getData()), enabled by Logger + CapConfig.loggingBehavior (default debug → on when the app is debuggable). The JS bridge (native-bridge.js, createLogFromNative/createLogToNative → c.dir(...)) mirrors it for results. Plugins that carry secrets (e.g. biometric credential storage, secure token storage) end up printing credentials verbatim to logcat.

Repro (any debug build, e.g. a biometric/token plugin):

  • adb logcat shows V Capacitor: callback: <id>, pluginId: <plugin>, methodName: setCredentials, methodData: {"username":"...","password":"<secret material>"}
  • Capacitor/Console shows the result: Msg: {"password":"{...access/refresh tokens...}"}

Impact: debug-only (release unaffected) — but devs run debug builds against real accounts, and logcat is readable via adb and captured in bug reports.

Suggestion: redact/omit methodData (and results) by default, or add a redaction option. loggingBehavior: 'none' disables ALL bridge logs, which removes useful debugging signal — a targeted redaction (e.g. keys like password/token/secret, or truncation) would be better.

Versions: @capacitor/core 8.5.2, @capacitor/android 8.5.2.

Lingua principale
TypeScript
Stelle
17k
Fork
1.3k
Merge medio
3g 11h
PR unite (30g)
31

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ionic-team/capacitor

Tutte le issue di ionic-team/capacitor

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.