Firefox · Networking
CVE-2025-0239
Logic Error in Networking
Overview
Medium
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Files Changed
netwerk/protocol/http/nsHttpConnection.cppnetwerk/test/unit/head_channels.js
Patch
diff --git a/netwerk/protocol/http/nsHttpConnection.cpp b/netwerk/protocol/http/nsHttpConnection.cpp
index e5d391604f3..8e9e8031a2d 100644
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -2419,6 +2419,17 @@ void nsHttpConnection::HandshakeDoneInternal() {
DebugOnly<nsresult> rvDebug = securityInfo->GetNegotiatedNPN(negotiatedNPN);
MOZ_ASSERT(NS_SUCCEEDED(rvDebug));
+ nsAutoCString transactionNPN;
+ transactionNPN = mConnInfo->GetNPNToken();
+ LOG(("negotiatedNPN: %s - transactionNPN: %s", negotiatedNPN.get(),
+ transactionNPN.get()));
+ if (!transactionNPN.IsEmpty() && negotiatedNPN != transactionNPN) {
+ LOG(("Resetting connection due to mismatched NPN token"));
+ DontReuse();
+ mTransaction->Close(NS_ERROR_NET_RESET);
+ return;
+ }
+
bool earlyDataAccepted = false;
if (mTlsHandshaker->EarlyDataUsed()) {
// Check if early data has been accepted.
diff --git a/netwerk/test/unit/head_channels.js b/netwerk/test/unit/head_channels.js
index 94a20b0a3d5..c4c28fa4e06 100644
--- a/netwerk/test/unit/head_channels.js
+++ b/netwerk/test/unit/head_channels.js
@@ -377,6 +377,7 @@ async function asyncStartTLSTestServer(
Services.env.set("LD_LIBRARY_PATH", greBinDir.path + ":/data/local/xpcb");
Services.env.set("MOZ_TLS_SERVER_DEBUG_LEVEL", "3");
Services.env.set("MOZ_TLS_SERVER_CALLBACK_PORT", CALLBACK_PORT);
+ Services.env.set("MOZ_TLS_ECH_ALPN_FLAG", "1");
let httpServer = new HttpServer();
let serverReady = new Promise(resolve => {
Loading diff…
Regression Test / PoC
shipped with the fix
diff --git a/netwerk/test/unit/head_channels.js b/netwerk/test/unit/head_channels.js
index 94a20b0a3d5..c4c28fa4e06 100644
--- a/netwerk/test/unit/head_channels.js
+++ b/netwerk/test/unit/head_channels.js
@@ -377,6 +377,7 @@ async function asyncStartTLSTestServer(
Services.env.set("LD_LIBRARY_PATH", greBinDir.path + ":/data/local/xpcb");
Services.env.set("MOZ_TLS_SERVER_DEBUG_LEVEL", "3");
Services.env.set("MOZ_TLS_SERVER_CALLBACK_PORT", CALLBACK_PORT);
+ Services.env.set("MOZ_TLS_ECH_ALPN_FLAG", "1");
let httpServer = new HttpServer();
let serverReady = new Promise(resolve => {
Loading diff…
References
On This Page