PerBothner / DomTerm

DOM/JavaScript-based terminal-emulator/console

Home Page:https://domterm.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

domterm.org is acting weird for Russian-speaking clients

yamnikov-oleg opened this issue · comments

domterm.org responds with a redirect to requests having "ru" in Accept-Language header. This redirect leads to a spammy Russian website.

Speaking in curl, here is a request with "ru":

$ curl "http://domterm.org/" -H "Accept-Language: ru" -v > /dev/null
<... some output omitted ...>
< HTTP/1.1 302 Found
< Date: Thu, 02 Aug 2018 18:27:47 GMT
< Server: Apache
< Location: http://news-of-wolrds.ru/06812
< Vary: Accept-Encoding
< Content-Length: 214
< Content-Type: text/html; charset=iso-8859-1
<

And here is request without "ru":

$ curl "http://domterm.org/" -H "Accept-Language: en" -v > /dev/null
<... some output omitted ...>
< HTTP/1.1 200 OK
< Date: Thu, 02 Aug 2018 18:34:43 GMT
< Server: Apache
< Last-Modified: Wed, 11 Jul 2018 23:32:58 GMT
< ETag: "2083-570c1aab75e33"
< Accept-Ranges: bytes
< Content-Length: 8323
< Vary: Accept-Encoding
< Content-Type: text/html
<

Thinking the problem is on my side, I've run these requests through Tor, but the behaviour persisted.

Clicking on a home page link in this repo's README results in the browser tab being instantly closed. But pasting the url directly into the address bar results in a redirect.

So I guess this behaviour changes based on the Referrer header.

There was a bad (malicious) .htaccess file. I've removed it, but there remains the question of how it got there.

The domterm.org directory in my account on DreamHost (where domterm.org is hosted) was group and world-writable. Fixed.