fix: wipe credentials in the connect path and keep release builds out of dumps and debuggers
- Credential callbacks (SecretFn) now return Zeroizing<String>, as do the
session-only/pending caches they read and the RDP client's password,
so Nexus's own copies are wiped; a plain String copy is made only
where a library API needs one (SSH password auth, IRC, VNC, CredSSP).
- Release builds disable core dumps (RLIMIT_CORE 0) and, on Linux, mark
the process non-dumpable (PR_SET_DUMPABLE 0), which also blocks ptrace
attach and /proc/<pid>/mem reads by other processes of the same user.
Debug builds are unchanged so they stay debuggable. Verified on the
release binary: core limit 0, /proc/<pid>/{environ,mem} root-owned and
unreadable, local shells (including cwd capture) still work.
Closes the remaining parts of SEC-20261012-007 that the app controls;
egui's internal text buffers remain outside its reach.
This commit is contained in:
@@ -37,7 +37,7 @@ pub struct Config {
|
||||
pub host: String,
|
||||
pub username: String,
|
||||
pub domain: String,
|
||||
pub password: String,
|
||||
pub password: zeroize::Zeroizing<String>,
|
||||
pub width: u16,
|
||||
pub height: u16,
|
||||
/// Also allow plain TLS (graphical logon) for servers without NLA, such as xrdp.
|
||||
@@ -121,7 +121,7 @@ impl Client {
|
||||
fn connector_config(&self) -> connector::Config {
|
||||
let c = &self.cfg;
|
||||
connector::Config {
|
||||
credentials: Credentials::UsernamePassword { username: c.username.clone(), password: c.password.clone() },
|
||||
credentials: Credentials::UsernamePassword { username: c.username.clone(), password: c.password.to_string() },
|
||||
domain: (!c.domain.is_empty()).then(|| c.domain.clone()),
|
||||
enable_tls: c.allow_tls_only,
|
||||
enable_credssp: true,
|
||||
@@ -458,7 +458,7 @@ mod tests {
|
||||
host: host.clone(),
|
||||
username: v[2].into(),
|
||||
domain: String::new(),
|
||||
password: v[3].into(),
|
||||
password: zeroize::Zeroizing::new(v[3].into()),
|
||||
width: 1024,
|
||||
height: 768,
|
||||
allow_tls_only: true,
|
||||
|
||||
Reference in New Issue
Block a user