CVE-2026-27489: Cpp Symlink Validation Missing Canonicalization

Validation of paths using `is_symlink()` only checks the final component of a path. If intermediate directories are symbolic links, this check can be bypassed, leading to path traversal vulnerabilities (CWE-59, CWE-22). Use `canonical()` or `weakly_canonical()` to fully resolve paths against the actual operating system file system.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0C++
greprules fetch cve-2026-27489-cpp-symlink-validation-missing-canonicalization --engine opengrep

Description

Validation of paths using `is_symlink()` only checks the final component of a path. If intermediate directories are symbolic links, this check can be bypassed, leading to path traversal vulnerabilities (CWE-59, CWE-22). Use `canonical()` or `weakly_canonical()` to fully resolve paths against the actual operating system file system.