Skip to content

Commit

Permalink
Hsts: match header names case insensitively (CVE-2023-32762)
Browse files Browse the repository at this point in the history
Header field names are always considered to be case-insensitive.

Pick-to: 6.5 6.5.1 6.2 5.15
Fixes: QTBUG-113392
Change-Id: Ifb4def4bb7f2ac070416cdc76581a769f1e52b43
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1b736a8)

* asturmlechner 2023-05-23: Upstream backport to 5.15 taken from
  https://www.qt.io/blog/security-advisory-qt-network
  • Loading branch information
Morten242 authored and tsdgeos committed Oct 4, 2023
1 parent a1ba7a9 commit 3e42ebf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/network/access/qhsts.cpp
Expand Up @@ -364,8 +364,8 @@ quoted-pair = "\" CHAR
bool QHstsHeaderParser::parse(const QList<QPair<QByteArray, QByteArray>> &headers)
{
for (const auto &h : headers) {
// We use '==' since header name was already 'trimmed' for us:
if (h.first == "Strict-Transport-Security") {
// We compare directly because header name was already 'trimmed' for us:
if (h.first.compare("Strict-Transport-Security", Qt::CaseInsensitive) == 0) {
header = h.second;
// RFC6797, 8.1:
//
Expand Down

0 comments on commit 3e42ebf

Please sign in to comment.