Browse Source

Escape the email in the client version log line

On a first SSO login the email comes from the identity provider and isn't validated yet, so a newline in it could add a line to the log.
pull/7765/head
Daniel García 4 days ago
committed by GitHub
parent
commit
35c662695c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      src/api/identity.rs

3
src/api/identity.rs

@ -533,7 +533,8 @@ fn check_client_version(user: &User, client_header: &ClientHeaders) -> EmptyResu
return Ok(());
};
Err(crate::error::Error::from((
format!("IP: {}. Username: {}. {error}", client_header.ip.ip, user.email),
// Escaped: on a first SSO login the email comes from the provider and isn't validated yet
format!("IP: {}. Username: {}. {error}", client_header.ip.ip, user.email.escape_debug()),
json!({
"error": error,
"error_description": description,

Loading…
Cancel
Save