{"id":"GHSA-98cp-84m9-q3qp","revision":null,"records":[{"revision":"ab6f2174ac9d4c8e88d664113f0bdcaa","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-41135","aliases":[],"title":"free5GC PCF: Memory Leak via CORS Middleware Registration in HTTP Handler Leads to Denial of Service","description":"free5GC UDR is the Policy Control Function (PCF) for free5GC, an an open-source project for 5th generation (5G) mobile core networks. A memory leak vulnerability in versions prior to 1.4.3 allows any unauthenticated attacker with network access to the PCF SBI interface to cause uncontrolled memory growth by sending repeated HTTP requests to the OAM endpoint. The root cause is a `router.Use()` call inside an HTTP handler that registers a new CORS middleware on every incoming request, permanently growing the Gin router's handler chain. This leads to progressive memory exhaustion and eventual Denial of Service of the PCF, preventing all UEs from obtaining AM and SM policies and blocking 5G session establishment. Version 1.4.3 contains a patch.","state":0,"publishedAt":"2026-04-21T23:49:19.659+00:00","modifiedAt":"2026-04-22T14:19:58.909+00:00","affected":[{"ecosystem":"Vendor product","name":"pcf","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"free5gc\",\n                    \"product\": \"pcf\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 1.4.3\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/free5gc/free5gc/security/advisories/GHSA-98cp-84m9-q3qp","https://github.com/free5gc/pcf/commit/599803b1b2eb4611e26d5216481ee142bce71a16"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-41135","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-41135","identifiers":["CVE-2026-41135"]},"retained":false,"historicalAffected":[]},{"revision":"fb2783ea18fb4d2e90b31538077083c3","observedAt":"2026-11-01T07:05:38.269+00:00","statement":{"source":"euvd","id":"EUVD-2026-24575","aliases":["CVE-2026-41135"],"title":"free5GC UDR is the Policy Control Function (PCF) for free5GC, an an open-source project for 5th generation (5G) mobile core networks. A memory leak vulnerability in versions prior to 1.4.3 allows any unauthenticated attacker with network ac…","description":"free5GC UDR is the Policy Control Function (PCF) for free5GC, an an open-source project for 5th generation (5G) mobile core networks. A memory leak vulnerability in versions prior to 1.4.3 allows any unauthenticated attacker with network access to the PCF SBI interface to cause uncontrolled memory growth by sending repeated HTTP requests to the OAM endpoint. The root cause is a `router.Use()` call inside an HTTP handler that registers a new CORS middleware on every incoming request, permanently growing the Gin router's handler chain. This leads to progressive memory exhaustion and eventual Denial of Service of the PCF, preventing all UEs from obtaining AM and SM policies and blocking 5G session establishment. Version 1.4.3 contains a patch.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":null}],"references":["https://github.com/free5gc/free5gc/security/advisories/GHSA-98cp-84m9-q3qp","https://github.com/free5gc/pcf/commit/599803b1b2eb4611e26d5216481ee142bce71a16"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-24575","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Apr 21, 2026, 11:49:19 PM","dateUpdated":"Apr 22, 2026, 2:19:58 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-24575","identifiers":["EUVD-2026-24575","CVE-2026-41135"]},"retained":false,"historicalAffected":[]},{"revision":"819006409def4def8e44387538944807","observedAt":"2026-10-27T10:10:07.342+00:00","statement":{"source":"nvd","id":"CVE-2026-41135","aliases":[],"title":"free5GC UDR is the Policy Control Function (PCF) for free5GC, an an open-source project for 5th generation (5G) mobile core networks. A memory leak vulnerability in versions prior to 1.4.3 allows any unauthenticated attacker with network ac…","description":"free5GC UDR is the Policy Control Function (PCF) for free5GC, an an open-source project for 5th generation (5G) mobile core networks. A memory leak vulnerability in versions prior to 1.4.3 allows any unauthenticated attacker with network access to the PCF SBI interface to cause uncontrolled memory growth by sending repeated HTTP requests to the OAM endpoint. The root cause is a `router.Use()` call inside an HTTP handler that registers a new CORS middleware on every incoming request, permanently growing the Gin router's handler chain. This leads to progressive memory exhaustion and eventual Denial of Service of the PCF, preventing all UEs from obtaining AM and SM policies and blocking 5G session establishment. Version 1.4.3 contains a patch.","state":0,"publishedAt":"2026-04-22T00:16:29.287+00:00","modifiedAt":"2026-10-26T22:10:00.163+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/free5gc/free5gc/security/advisories/GHSA-98cp-84m9-q3qp","https://github.com/free5gc/pcf/commit/599803b1b2eb4611e26d5216481ee142bce71a16"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-41135","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-400"],"productCriteria":["cpe:2.3:a:free5gc:free5gc:*:*:*:*:*:*:*:*","cpe:2.3:a:free5gc:pcf:*:*:*:*:*:*:*:*"],"sourceDates":{"published":"2026-04-22T00:16:29.287","lastModified":"2026-10-26T22:10:00.163"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-41135","identifiers":["CVE-2026-41135"]},"retained":false,"historicalAffected":[]},{"revision":"42d8102094534ac3bf5c99cf38859990","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-98cp-84m9-q3qp","aliases":["CVE-2026-41135","GO-2026-5278"],"title":"free5GC PCF: Memory Leak via CORS Middleware Registration in HTTP Handler Leads to Denial of Service","description":"## Summary\n\nA memory leak vulnerability in the free5GC PCF (Policy Control Function) allows any unauthenticated attacker with network access to the PCF SBI interface to cause uncontrolled memory growth by sending repeated HTTP requests to the OAM endpoint. The root cause is a `router.Use()` call inside an HTTP handler that registers a new CORS middleware on every incoming request, permanently growing the Gin router's handler chain. This leads to progressive memory exhaustion and eventual Denial of Service of the PCF, preventing all UEs from obtaining AM and SM policies and blocking 5G session establishment.\n\n## Details\n\n**File:** `free5gc/pcf/internal/sbi/api_oam.go`  \n**Function:** `setCorsHeader()`, called by `HTTPOAMGetAmPolicy()`\n\nThe function `setCorsHeader()` invokes `s.router.Use()` on every incoming HTTP request:\n\n```go\nfunc (s *Server) setCorsHeader(c *gin.Context) {\n    // BUG: router.Use() inside a handler — executes on every request\n    s.router.Use(cors.New(cors.Config{\n        AllowMethods:     []string{\"GET\", \"POST\", \"OPTIONS\", \"PUT\", \"PATCH\", \"DELETE\"},\n        AllowAllOrigins:  true,\n        AllowCredentials: true,\n        MaxAge:           CorsConfigMaxAge,\n    }))\n    // Redundant manual header setting\n    c.Writer.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n    c.Writer.Header().Set(\"Access-Control-Allow-Credentials\", \"true\")\n    // ...\n}\n\nfunc (s *Server) HTTPOAMGetAmPolicy(c *gin.Context) {\n    s.setCorsHeader(c) // ← called on every GET /npcf-oam/v1/am-policy/:supi\n    // ...\n}\n```\nIn the Gin framework, `router.Use()` appends a new `HandlerFunc` to the router's internal middleware slice. This operation is **not idempotent** — it does not replace existing middleware but appends a new instance on every call. After N requests, Gin executes N CORS middleware instances before reaching the actual handler:\n\nRequest N → [cors_mw_1 → cors_mw_2 → ... → cors_mw_N → actual_handler]\n\nSince `s.router` holds a permanent reference to the accumulated middleware slice, the Go garbage collector cannot free this memory. The additional issue of `AllowAllOrigins: true` combined with `AllowCredentials: true` also constitutes a CORS misconfiguration (forbidden by the CORS specification), though this is secondary to the memory leak.\n\n**Fix:** Move `router.Use(cors.New(...))` to the server initialization function (called once at startup), and remove `setCorsHeader()` from all handlers entirely:\n\n```go\n// ✅ server.go — called once at startup\nfunc (s *Server) initRouter() {\n    s.router.Use(cors.New(cors.Config{\n        AllowMethods:     []string{\"GET\", \"POST\", \"OPTIONS\", \"PUT\", \"PATCH\", \"DELETE\"},\n        AllowOrigins:     []string{\"https://trusted-origin.example.com\"},\n        AllowCredentials: false,\n        MaxAge:           CorsConfigMaxAge,\n    }))\n}\n```\n## PoC\n\n**Environment:**\n- free5GC v4.2.1 (commit `df535f55`, build `2026-03-04`)\n- PCF container IP: `10.22.22.6`, port `80`\n- Attacker: any container on the same Docker network (tested from UDM container)\n- No authentication required (OAuth2 disabled)\n\n**Step 1** — Record memory baseline:\n```bash\ndocker stats --no-stream | grep pcf\n# Output: 24.86 MiB\n```\n\n**Step 2** — Launch flood from attacker container:\n```bash\nfor i in $(seq 1 5000); do\n    curl -s http://10.22.22.6/npcf-oam/v1/am-policy/imsi-222771234567890 > /dev/null &\n    [ $((i % 100)) -eq 0 ] && wait && echo \"[*] $i req sent\"\ndone\nwait\n```\n\n**Step 3** — Monitor memory growth:\n```bash\nwatch -n 2 \"docker stats --no-stream | grep pcf\"\n```\n\n**Results:**\n\n| Requests sent | PCF Memory | Delta      |\n|---------------|------------|------------|\n| 0 (baseline)  | 24.86 MiB  | —          |\n| ~5,000        | 46.48 MiB  | +21.62 MiB |\n| ~10,000       | 58.59 MiB  | +12.11 MiB |\n| ~15,000       | 70.30 MiB  | +11.71 MiB |\n| ~100,000 (projected) | ~170+ MiB | OOM kill |\n\nMemory never returns to baseline between request batches, confirming permanent retention by the router's middleware chain.\n\n## Impact\n\n**Vulnerability type:** Uncontrolled Resource Consumption (Memory Exhaustion) leading to Denial of Service.\n\n**Who is impacted:** Any deployment of free5GC where the PCF OAM interface is reachable from the internal 5G core network. Since all 5G core NFs share the same Docker network by default, any compromised or attacker-controlled NF container can trigger this vulnerability without credentials.\n\n**5G service impact:** The PCF is responsible for providing AM (Access and Mobility) policies to the AMF and SM (Session Management) policies to the SMF. A DoS of the PCF prevents:\n- New UE registrations (AM policy creation fails)\n- New PDU session establishment (SM policy creation fails)\n- Policy updates for existing sessions\n\nIn a production deployment this would result in complete loss of 5G service for all subscribers served by the affected PCF instance.","state":0,"publishedAt":"2026-04-22T19:49:45+00:00","modifiedAt":"2026-06-25T19:56:26.7670074+00:00","affected":[{"ecosystem":"Go","name":"github.com/free5gc/pcf","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.4.3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/free5gc/free5gc/security/advisories/GHSA-98cp-84m9-q3qp","https://nvd.nist.gov/vuln/detail/CVE-2026-41135","https://github.com/free5gc/free5gc"],"sourceUrl":"https://github.com/advisories/GHSA-98cp-84m9-q3qp","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-98cp-84m9-q3qp","identifiers":["GHSA-98cp-84m9-q3qp","CVE-2026-41135","GO-2026-5278"]},"retained":false,"historicalAffected":[]},{"revision":"a6c66642455a4ac681e0b303ec914982","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-5278","aliases":["CVE-2026-41135","GHSA-98cp-84m9-q3qp"],"title":"free5GC PCF: Memory Leak via CORS Middleware Registration in HTTP Handler Leads to Denial of Service in github.com/free5gc/pcf","description":"free5GC PCF: Memory Leak via CORS Middleware Registration in HTTP Handler Leads to Denial of Service in github.com/free5gc/pcf","state":0,"publishedAt":"2026-06-25T18:43:15+00:00","modifiedAt":"2026-06-25T19:45:26.297632+00:00","affected":[{"ecosystem":"Go","name":"github.com/free5gc/pcf","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.4.3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/free5gc/free5gc/security/advisories/GHSA-98cp-84m9-q3qp","https://nvd.nist.gov/vuln/detail/CVE-2026-41135"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-5278","license":"OSV · upstream source license applies","key":"osv:GO-2026-5278","identifiers":["GO-2026-5278","CVE-2026-41135","GHSA-98cp-84m9-q3qp"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-01T15:57:20.8239354+00:00","complete":true,"records":1766,"lastAttemptAt":"2026-11-01T15:57:20.8239354+00:00","lastSuccessAt":"2026-11-01T15:57:21.0432994+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:21.0433001+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-aece262bb10a694367a43c24d730aa8e8dc171723eaec4c15cdd32f04bda103f-f95a49f7991d84fda391d9ec67b41d459e583b1cfe7c441477d04d1fe019c90a","complete":true,"records":417656,"lastAttemptAt":"2026-11-01T15:57:20.2988428+00:00","lastSuccessAt":"2026-11-01T15:57:20.2714671+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.2988428+00:00","snapshotPublishedAt":"2026-11-01T15:25:59+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-996acc6ac5ed4512972e5675464bd820","complete":false,"records":13568,"lastAttemptAt":"2026-11-01T16:09:37.8504098+00:00","lastSuccessAt":"2026-11-01T16:09:37.846+00:00","error":null,"lastVerifiedAt":"2026-11-01T16:09:37.846+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13449,"expectedIdentifiers":13637,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-01T15:57:20.8239354+00:00","complete":true,"records":1095,"lastAttemptAt":"2026-11-01T15:57:20.8239354+00:00","lastSuccessAt":"2026-11-01T15:57:21.0444496+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:21.0444501+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-f67819536b464ba998dbfc5a485cc684","complete":true,"records":13580,"lastAttemptAt":"2026-11-01T15:57:46.3017893+00:00","lastSuccessAt":"2026-11-01T15:57:46.298+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:46.298+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13637,"expectedIdentifiers":13637,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-21dcd6662970dfea02e4ea60ee637115e8d92664947484d2b9276b3f6568a84f","complete":true,"records":9815,"lastAttemptAt":"2026-11-01T15:57:20.6646449+00:00","lastSuccessAt":"2026-10-30T23:47:34.1817587+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.6646449+00:00","snapshotPublishedAt":"2026-10-30T23:33:17+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-2de9ccc5290f060c7aa63f89c25dd76f655a64ba1aba7c05c97fa3bee4f09899","complete":true,"records":1967,"lastAttemptAt":"2026-11-01T15:57:20.4527932+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.4527932+00:00","snapshotPublishedAt":"2026-10-28T20:03:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-f95f76cd406ae5bae3de632ad37fd2d5160b44f5e6b51748ac6f8f0c0c88e72b","complete":true,"records":3028,"lastAttemptAt":"2026-11-01T15:57:20.7894926+00:00","lastSuccessAt":"2026-10-30T23:47:38.4914494+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.7894926+00:00","snapshotPublishedAt":"2026-10-30T23:18:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-55acacd40a7aab88cf530cfddf98233a5d800cfc6bb1883653ecf5bee50f4426","complete":true,"records":230996,"lastAttemptAt":"2026-11-01T15:57:20.5571291+00:00","lastSuccessAt":"2026-11-01T09:06:49.6961926+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.5571291+00:00","snapshotPublishedAt":"2026-11-01T08:33:39+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}