Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Sanitize SQL queries

Aperta
#6,019 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
android, java, kotlin, sql, sqlite

Direzione di ricerca

Individua la strumentazione di sentry-jdbc e sentry-android-sqlite, inclusi i punti di ingresso SupportSQLiteOpenHelper e SQLiteDriver, e prendi in esame SqlSanitizerWithSummary.jflex di OpenTelemetry Java come precedente. Il lavoro è completato quando tutte le istruzioni producono descrizioni strutturali sicure degli span senza esporre letterali o commenti, con copertura per input malformati, dialetti, secret-canary, fuzz/robustezza e prestazioni.

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

Descrizione

Feature Java Platform: Java Spans
Problem Statement

Our JDBC and Android SQLite integrations currently use caller-provided SQL directly as the span description. If a customer interpolates values instead of using placeholders, literals and comments can contain PII, credentials, or other sensitive data and are sent to Sentry. The Java SDK has no SQL sanitizer today.

Solution Brainstorm

Introduce a shared internal SQL analyzer used by sentry-jdbc and sentry-android-sqlite.

Requirements:

  • Sanitize every statement, including prepared-statement text.
  • Replace literal values with placeholders while preserving SQL structure and existing parameter markers.
  • Remove or redact line and block comments.
  • Handle database dialect differences conservatively.
  • Never fall back to, attach, or log the original query if analysis fails; fail closed to safe structural metadata.
  • Use sanitized query text as the transaction-based span description.
  • Cover JDBC, SupportSQLiteOpenHelper, and SQLiteDriver instrumentation.
  • Add malformed-input, dialect, secret-canary, fuzz/robustness, and performance tests.

OpenTelemetry Java's Apache-2.0 JFlex SqlSanitizerWithSummary.jflex is strong prior art and can likely be adapted, but should not be vendored unchanged: OTel preserves comments, may skip sanitization for prepared statements, and preserves unknown fragments. Vendoring requires source attribution and a THIRD_PARTY_NOTICES.md entry.

Lingua principale
Kotlin
Stelle
1.4k
Fork
478
Merge medio
3g 2h
PR unite (30g)
70

Guida per i contributori

Apri la guida per i contributori

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 getsentry/sentry-java

Tutte le issue di getsentry/sentry-java

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.