fix reflected xss when returning errors on web endpoint

Reported by Filippo Decortes from ares-cyber.ai
This commit is contained in:
trinity-1686a
2026-06-10 19:32:58 +02:00
parent 2bde733e09
commit da568cf56f
4 changed files with 19 additions and 1 deletions
+1
View File
@@ -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
+1 -1
View File
@@ -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));