CodeVetter · Repo Unpack · Risk map
SeaQL/sea-orm
The following risks are source observations or explicitly labeled hypotheses, not confirmed vulnerabilities. Sensitive boundaries include database configuration, SQL construction, authorization snapshots, filesystem generation, and subprocess execution. Migration and synchronous-generation utilities have broad side effects that deserve particular attention during future authorized work.
- Hypothesis: caller-controlled PostgreSQL schema strings could cross a SQL trust boundary because CLI sqlx_connect interpolates schema into SET search_path and marks the resulting string AssertSqlSafe; the runtime connector also constructs search-path SQL directly. Exploitability was not tested. (inferred)
- Connection diagnostics can contain sensitive configuration: Database::connect includes the supplied URL in parsing/driver errors, ConnectOptions derives Debug with URL and SQLCipher fields, and metric callbacks receive statements with parameters.
- Entity generation writes directly into a caller-selected output directory before rustfmt and final fallback checks; preservation excludes mod.rs, lib.rs, prelude.rs, and active-enum files, while parse fallback preserves old source as comments rather than active code.
- Migration tooling launches cargo with a selected manifest and inherited/overridden database environment; update_migrator rewrites Rust through timestamp-module and vec! regexes, truncates the destination after backing it up, and removes the backup after writing.
- Hypothesis: application code retaining ordinary DatabaseConnection handles can bypass optional RBAC wrappers, and policy changes require explicit engine replacement to affect the loaded snapshot. RestrictedConnection checks structured statements, whereas the underlying connection remains available. (inferred)
- Migration atomicity is conditional: defaults wrap PostgreSQL migrations but not MySQL/SQLite, with per-migration overrides; the nontransactional branch executes migration.up before inserting its tracking record. fresh invokes database-wide table/type dropping within its discovered scope.
- ProxyDatabaseTrait defaults transaction hooks to no-ops and ping to success; the GlueSQL example supports limited value/payload variants, contains panic/todo branches, and returns fixed last_insert_id and rows_affected values.
- make-sync.sh deletes and recopies the synchronous source/test trees, then applies broad textual transformations to async syntax, trait bounds, streams, and locks; its blast radius includes synchronized tests and examples, so isolated mirror edits can be overwritten.