Mailing List Archive

[6.0] 9c85dcbb3 hpack: Validate header values with vct_ishdrval()
commit 9c85dcbb31caf3a01a22b4fb148bd9b081839eae
Author: Walid Boudebouda <walid.boudebouda@gmail.com>
Date: Fri Sep 8 17:37:26 2023 +0200

hpack: Validate header values with vct_ishdrval()

Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>

diff --git a/bin/varnishd/http2/cache_http2_hpack.c b/bin/varnishd/http2/cache_http2_hpack.c
index 529bc31eb..4a1140291 100644
--- a/bin/varnishd/http2/cache_http2_hpack.c
+++ b/bin/varnishd/http2/cache_http2_hpack.c
@@ -110,9 +110,9 @@ h2h_checkhdr(const struct http *hp, const char *b, size_t namelen, size_t len)
state = FLD_VALUE;
/* FALL_THROUGH */
case FLD_VALUE:
- if (*p != 0x09 && (*p < 0x20 || *p == 0x7f)) {
+ if (!vct_ishdrval(*p)) {
VSLb(hp->vsl, SLT_BogoHeader,
- "Illegal field value (control) %.*s",
+ "Illegal field value %.*s",
(int)(len > 20 ? 20 : len), b);
return (H2SE_PROTOCOL_ERROR);
}
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit