Drupal attacks
TL;DR: Drupalgeddon-class form-API injection, REST/JSON:API surface, Twig SSTI in custom modules, and the long tail of contrib-module CVEs.
What it is
Drupal is a modular PHP CMS. Attack surface splits across the core form API (where most “Drupalgeddon” bugs lived), the REST/JSON:API/GraphQL modules now standard in 9/10, the Twig templating engine, and a huge ecosystem of contributed modules that ship their own bugs.
Preconditions / where it applies
- Drupal 7, 8, 9, or 10 instance — fingerprint via
/CHANGELOG.txt(older),/core/CHANGELOG.txt,X-Generator: Drupal N,/sites/default/files,Drupal.settingsJS blob. - Sometimes anonymous access to the REST/JSON:API endpoints; sometimes an authenticated low-priv role.
- Outdated core or any contributed module with a published advisory at https://www.drupal.org/security.
Technique
- Fingerprint and enumerate.
droopescan scan drupal -u https://target/lists core + module versions; manual checks at/core/CHANGELOG.txt,/modules/<name>/<name>.info.yml. -
CVE-2018-7600 (Drupalgeddon2). Core form API on 7.x/8.x —
#post_render/#markupproperties injected via form fields render attacker PHP. Mass-exploited in the wild.1 2
POST /user/register?element_parents=account/mail/%23value&ajax_form=1 HTTP/1.1 form_id=user_register_form&_drupal_ajax=1&mail[#post_render][]=exec&mail[#type]=markup&mail[#markup]=id
- CVE-2019-6340 (REST module). Unsafe deserialisation in field normalisation via REST PATCH on 8.5–8.6 — see deserialisation.
- CVE-2018-7602. Drupalgeddon3 — same family as 7600, requires an authenticated user.
- JSON:API enumeration.
/jsonapi/node/articleand/jsonapi/user/useroften expose data without auth; filter with?filter[uid]=1and similar. - Twig SSTI in custom templates. When a developer echoes user data into
{{ }}without|e, you get an ssti sink —{{ _self.env.registerUndefinedFilterCallback("exec") }}. - PHP filter / files module misuse. If anonymous file upload is allowed and
.htaccessis missing or weak insites/default/files/, drop a.php(older Drupal) or chain with an LFI to evaluate it. - Admin takeover via stolen session. Drupal session cookies have the pattern
SESS<hash>; combine with cross-site-scripting in a custom block.
Detection and defence
- Stay on the latest minor; subscribe to security advisories and patch within the published window.
- Disable REST/JSON:API endpoints you do not use; lock those you do behind auth and per-role permissions.
- Run Drupal behind a WAF rule set that catches the Drupalgeddon
#post_rendershape; alert on?element_parents=and similar form-API parameter names from anon users. - Detection: web logs with POST to
/user/register?element_parents=; PHP error logs referencingDrupal\Component\Render\MarkupInterface; new PHP files appearing undersites/default/files.
References
- Drupal Security Advisories — canonical advisory feed.
- Drupalgeddon2 (SA-CORE-2018-002) write-up — root cause and PoC.
- Drupal REST/JSON:API docs — endpoints and auth.