We have a Production Drupal server serving content but some pages are broken when a pager link is clicked upon. It was found that the URL's are being changed with unrecognizable keywords. For example,

For the URL


the URL is changed to


Similarly, cmd.php is sometimes replaced by /contact and /www.googletagmanager.com/ns.html in the last few days.

The Drupal log has a successful GET when the link is clicked as shown below. By the looks of it, we suspect a SQL injection. What do you think?

www.foo.com/poem/case/index.html/contact?search_api_views_fulltext=&page=21&%3Bamp%2525252525253bamp%2525252525253b%2525252525253bamp%2525252525253bpage=1&%3Bamp%2525252525253bamp%2525252525253b%2525252525253bpage=1&%3Bamp%2525252525253bamp%2525252525253bpage=3&%3Bamp%2525252525253bpage=2&%3Bpage=3 HTTP/1.1" 200 19997

  • 1
    I don't see any SQL injection there. What happened when you inspected the filesystem for things that shouldn't be there? Feb 1 '17 at 3:51
  • We searched the entire DB on production for the string “cmd.php”. It only appeared in two tables. Being in table-1 is a natural result of the flawed pages being visited. The flawed entries in table-2 could be a result of hack. When hackers exploit sql injection they sometimes obscure their stuff by encoding it, say into base64 making it virtually impossible to find.
    – Lego
    Feb 1 '17 at 11:13
  • That log line has nothing like SQL in it. It could be an attempt to exploit some existing Drupal security issue. Feb 1 '17 at 11:32
  • Any thoughts on why keywords like cmd.php or contact get inserted in the URLs while we click on certain links?
    – Lego
    Feb 1 '17 at 12:34

This sounds possibly like a side effect of someone trying various exploits (this is common for sites to get probed event for WP vulns) and accidentally poisoning the cache of rendered content.

some examples of such issues: https://www.drupal.org/node/2847972 https://www.drupal.org/node/2819197

I'm also a little confused why any of your paths would have index.html - is that just an alias?


some pages are broken when a pager link is clicked upon

This sounds like an issue with

  1. Broken code for generating the pagers - is it core or a contrib? It seems broken, but not necessarily in a way that represents a security bug.
  2. Broken caching code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.