mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-08 05:43:13 +00:00
fix reflected xss when returning errors on web endpoint
Reported by Filippo Decortes from ares-cyber.ai
This commit is contained in:
@@ -20,6 +20,7 @@ garage_model.workspace = true
|
||||
garage_util.workspace = true
|
||||
garage_table.workspace = true
|
||||
|
||||
html-escape.workspace = true
|
||||
thiserror.workspace = true
|
||||
tracing.workspace = true
|
||||
percent-encoding.workspace = true
|
||||
|
||||
@@ -483,7 +483,7 @@ fn error_to_res(e: Error) -> Response<BoxBody<Error>> {
|
||||
<li>Message: {s3_message}.</li>
|
||||
</ul>",
|
||||
s3_code = err.aws_code(),
|
||||
s3_message = err,
|
||||
s3_message = html_escape::encode_text(&err.to_string()),
|
||||
));
|
||||
}
|
||||
let mut http_error = Response::new(string_body(body_str));
|
||||
|
||||
Reference in New Issue
Block a user