Summary
In src-tauri/src/db/connections.rs (lines 85-94), database credentials are interpolated directly into connection URLs without URL encoding:
```rust
format!("postgres://{}:{}@{}:{}/{}", self.user, self.password, self.host, self.port, self.database)
```
Risk
Passwords containing @, :, /, ?, #, or % will break the connection URL parser or route credentials to the wrong host. A password like p@ssword would be parsed as user:p with host ssword. Severity is medium — causes connection failures and could theoretically leak credentials to unintended hosts.
Remediation
URL-encode user and password before interpolation:
```rust
use urlencoding::encode;
format!("postgres://{}:{}@{}:{}/{}", encode(&self.user), encode(&self.password), ...)
```
Add the urlencoding crate or use percent_encoding from the url crate (already a transitive dep).
Summary
In src-tauri/src/db/connections.rs (lines 85-94), database credentials are interpolated directly into connection URLs without URL encoding:
```rust
format!("postgres://{}:{}@{}:{}/{}", self.user, self.password, self.host, self.port, self.database)
```
Risk
Passwords containing @, :, /, ?, #, or % will break the connection URL parser or route credentials to the wrong host. A password like p@ssword would be parsed as user:p with host ssword. Severity is medium — causes connection failures and could theoretically leak credentials to unintended hosts.
Remediation
URL-encode user and password before interpolation:
```rust
use urlencoding::encode;
format!("postgres://{}:{}@{}:{}/{}", encode(&self.user), encode(&self.password), ...)
```
Add the urlencoding crate or use percent_encoding from the url crate (already a transitive dep).