Mittel

Smarty: Symlink path traversal out of trusted directories

  • Veröffentlicht: 07.08.2026
  • Aktualisiert: 11.10.2026 10:22

When Smarty's Security policy is enabled, secure_dir (and the configured template/trusted directories) restrict which local files a template may read via {include} and {fetch}. The trust check in Security::_checkDir() resolved the requested path with Smarty::_realpath(), which normalizes the path as a string only and does not follow symbolic links. A symlink placed inside a trusted directory therefore passed the trust check, while the underlying file_get_contents() followed it to an arbitrary file outside the sandbox (e.g. /etc/passwd).

Impact

An attacker able to (a) cause a symlink to exist inside a trusted directory (e.g. a user-upload area located within the template path) and (b) cause a template to reference that path can read arbitrary files readable by the PHP process, escaping the secure_dir boundary. Confidentiality impact only.

Patches

Fixed in 5.8.2. Security::_checkDir() now resolves the requested file with native realpath() and re-validates the canonical, symlink-free path against the trusted directories (which are canonicalized the same way, so legitimate symlinked deployment paths such as a Capistrano current symlink or macOS /var → /private/var keep working). It falls back to string normalization only when the file does not yet exist on disk.

Workarounds

Ensure no untrusted symlinks can be created within any directory listed in secure_dir/the trusted template directories; restrict write access to those directories to trusted processes only.

References

  • Fix commit: 99c048c
  • CWE-22

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Composer-Paket smarty/smarty >= 5.0.0, < 5.8.2, < 4.5.7 5.8.2, 4.5.7

Verweise

CVSS-Wert -
CVSS-Vektor
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Schwäche (CWE)
CWE-22, CWE-61
Plattform
Composer
Paket
smarty/smarty
Veröffentlicht
07.08.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-f6wf-28g6-769x - CC BY 4.0

Schwachstellenhistorie: smarty/smarty

Alle veröffentlichten Schwachstellen dieses Pakets (Composer-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (18) im Archiv
Einträge insgesamt
18
Erste → letzte
02.2021 09.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 3
  • Hoch 8
  • Mittel 7

Veröffentlichungen pro Jahr

  1. 2021: 2
  2. 2022: 11
  3. 2023: 1
  4. 2024: 1
  5. 2025: 0
  6. 2026: 3
Schweregrad:
  1. Smarty: Symlink path traversal out of trusted directories dieser Eintrag
    Mittel CVE-2026-62992 >= 5.0.0, < 5.8.2, < 4.5.7 5.8.2, 4.5.7
  2. Hoch · 7.3 CVE-2024-35226 >= 5.0.0, < 5.1.1, >= 3.0.0, < 4.5.3 5.1.1, 4.5.3
  3. Hoch · 7.1 CVE-2023-28447 >= 4.0.0, < 4.3.1, < 3.1.48 4.3.1, 3.1.48
  4. Hoch · 8.8 CVE-2022-29221 < 3.1.45, >= 4.0.0, < 4.1.1 3.1.45, 4.1.1
  5. Hoch CVE-2014-8350 < 3.1.21 3.1.21
  6. Kritisch · 9.8 CVE-2017-1000480 >= 3, < 3.1.32 3.1.32
  7. Hoch · 7.5 CVE-2018-13982 < 3.1.33 3.1.33
  8. Kritisch · 9.8 CVE-2011-1028 < 3.0.7 3.0.7
  9. Hoch · 8.8 CVE-2021-21408 < 3.1.43, >= 4.0.0, < 4.0.3 3.1.43, 4.0.3
  10. Hoch · 8.1 CVE-2021-29454 < 3.1.42, >= 4.0.0, < 4.0.2 3.1.42, 4.0.2
  11. Hoch · 7.5 CVE-2021-26119 < 3.1.39 3.1.39
  12. Kritisch · 9.8 CVE-2021-26120 < 3.1.39 3.1.39

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.