diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 9801fe1c8e..6ea25eb0be 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -873,6 +873,18 @@ static int HTPCallbackRequestUriNormalizePath(htp_connp_t *c) if (c->in_tx->parsed_uri->path != NULL) { htp_decode_path_inplace(c->cfg, c->in_tx, c->in_tx->parsed_uri->path); + + /* Handle UTF-8 in path */ + if (c->cfg->path_convert_utf8) { + /* Decode Unicode characters into a single-byte stream, using best-fit mapping */ + htp_utf8_decode_path_inplace(c->cfg, c->in_tx, c->in_tx->parsed_uri->path); + } else { + /* Only validate path as a UTF-8 stream */ + htp_utf8_validate_path(c->in_tx, c->in_tx->parsed_uri->path); + } + + /* normalize after decoding */ + htp_normalize_uri_path_inplace(c->in_tx->parsed_uri->path); } SCReturnInt(HOOK_OK);