CodeVetter · Repo Unpack · Risk map
diesel-rs/diesel
These findings describe source-level trust boundaries and review hotspots, not runtime-confirmed vulnerabilities. Database operations can mutate remote databases or local files, and raw SQL reduces compile-time validation. Migration commits and schema-file verification occur at different stages. The advanced blog example contains security-relevant teaching shortcuts and an update target that warrants focused review.
- Source observation: EditComment loads a comment scoped to the current user, but executes diesel::update(comments) without a filter or identified-record target; the update construction does not preserve the preceding ownership selection.
- Source observation: blog registration hashes passwords with Argon2 using a constant salt; the implementation explicitly warns against this pattern in real applications.
- Operational boundary: database reset calls drop before setup; server backends execute DROP DATABASE, while SQLite drop removes an existing path supplied as database_url.
- Source observation: --locked-schema validation runs after migrations; a schema mismatch returns SchemaWouldChange, and the inspected dispatch provides no enclosing rollback around migration execution and file comparison.
- Migration metadata read/parse errors are discarded by unwrap_or_default; transaction-disabled migrations execute SQL and insert bookkeeping without the harness transaction wrapper.
- Raw SqlQuery binds cannot validate SQL placeholder types or parameter counts, and dynamic schemas cannot verify runtime table/column existence or declared types; these are documented reductions in static guarantees.
- Native PostgreSQL execution crosses unsafe libpq boundaries for connection pointers and parameter arrays; Statement::execute includes explicit i32 conversion checks, so preserving ownership and bounds behavior is essential when editing this code.
- External trust boundaries include PATH-resolved rustfmt, VISUAL/EDITOR-selected subprocesses, temporary editor files, and configured schema/patch paths; relative paths are joined to the config directory without a repository-containment check in the inspected code.