Forum Moderators: open

Message Too Old, No Replies

Possible Same-Site Scripting issue?

         

csdude55

5:51 am on Feb 11, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I got an email from someone that had registered on my site today; it feels spam, but they spent an unusual amount of time researching the site and even sent screenshots! Worse, they forgot to ask for money :-O

So I'm curious how much to worry about this. The emails says (replacing my domain with "example.com", of course):

I Am Found Vulnerability DNS-Misconfiguration-->Same-Site Scripting ,

Your website deals with security issues.

Description:-
This is also not an xss/JavaScript injection issue, but a DNS misconfiguration that bypasses the same domain policy and allows non-injected JavaScript from the local host to run in the context of pages served by the misconfigured domain.

Tavis Ormandy reported a common DNS misconfiguration that can result in a minor security issue with web applications.

"It's a common and sensible practice to install records of the form "localhost. IN A 127.0.0.1" into nameserver configurations, bizarrely however, administrators often mistakenly drop the trailing dot, introducing an interesting variation of Cross-Site Scripting (XSS) I call Same-Site Scripting. The missing dot indicates that the record is not fully qualified, and thus queries of the form "localhost.example.com" are resolved. While superficially this may appear to be harmless, it does in fact allow an attacker to cheat the RFC2109 (HTTP State Management Mechanism) same origin restrictions, and therefore hijack state management data."

Your localhost.example.com has address 127.0.0.1 and this may lead to "Same- Site" Scripting.

I can also ping the localhost network from localhost.example.com , as in the image attachment "PING TO LOCALHOST .example.com"
127.0.0.1 host localhost.example.com

The Impact of this Vulnerability :-

An attacker can cheat the RFC2109 (HTTP State Management Mechanism ) same origin restrictions, and therefore hijack State Management data.

Remediation :-
It is advised that non-FQ localhost entries be removed from nameserver configurations for domains that host websites that rely on HTTP state management.


I looked in my DNS records and do have an A record for:

localhost.example.com. 14400 A 127.0.0.1

Is there a reason to be concerned?

topr8

8:40 am on Feb 11, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



i found copies of that message using google, going back to 2008.

robzilla

9:18 am on Feb 11, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Someone would probably need local access to your server to exploit that: [seclists.org...]

But if you don't use it, might as well lose it.

csdude55

6:49 pm on Feb 11, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I did that, too, @topr8, but couldn't find whether it was a REAL concern or not! LOL I was really just surprised that it wasn't a bot, someone physically went to my site, created an account, and then took screenshots to email me.

I THINK that MySQL uses localhost? I'm not sure if I need it as an A record, though.

robzilla

8:18 pm on Feb 11, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not sure if I need it as an A record, though.

You don't. The localhost that MySQL connects through is defined locally in your hosts file, i.e. /etc/hosts on Unix-based machines.

The "vulnerability" is about having a DNS record for localhost.example.com, which is quite different.

Maybe there's a situation where having a localhost.example.com record is helpful, but... I can't think of one.

Dimitri

12:08 am on Feb 12, 2022 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



It's a common

Okay, certainly, if it's said, but, it never came to my mind to create a DNS entry to point to 127.0.0.1 ...

For testing purpose, it happens I am resolving a domain name to my local machine, but to do so , I use the hosts file and not the public DNS.

Also, from a security point of view, what's the difference between resolving a sub domain to the localhost at the level of the public DNS or in the local DNS hosts file?

robzilla

1:30 am on Feb 12, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Someone would probably need local access to your server to exploit that

Oops, access to the client's device actually. If I understand it correctly, the attack would involve setting up a stealth web server on the client's device, listening to localhost.example.com which thanks to the DNS record would resolve to the local network (on the client side). Then that server would theoretically be able to access (potentially sensitive) data stored for the main domain, much like with a Cross-Site Scripting attack but using the same domain, hence "Same-Site Scripting". It's a non-issue if HSTS is employed for the main domain, because there would be no valid TLS certificate for localhost.example.com.

All in all, a bit random that someone is notifying you of this in 2022. Some script kiddie out looking for vulnerabilities, perhaps.