Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

You're right, that's kind of what I got from it by reading the other thread after posting...

You'd need to visit a page that exploits JS to make those connections to get that cookie. Afterwards, I guess it depends.



sort by: page size:

Sure, which again means it's on a web application level rather than working at the HTTP level.

There are lots of uses for cookies without having JS or a full browser available.


Even if you don't have cookies enabled, then browser fingerprinting could make the connection.

I'm not sure I follow. Cookies are stored in the client.

Yep. I believe the idea is to trick the browser into believing that you're interacting with the third-party site so that they get first-party treatment with respect to cookies and such.

I'm not sure if it's still true, but at one point, submitting a form (even via JavaScript) counted and let the site store cookies.


Can't you just read document.cookies to get the token at that point?

Can client-side code set the cookies themselves? I was under the impression cookies were a HTTP-level thing.

> every website gets to read only its own cookies

That's already the case, isn't it? It's just that embedded parts by a 3rd party can set their own cookies, which can be read by the 3rd party whenever it is embedded in any other page.


But, if the site is using only HTTP and cookies, there's no reason not to first make a request to the login page with the username/password and retrieve the cookie via the "cookie" header that comes back... Did I totally misread the article, or was it just dumb?

you wouldn't get access to the cookie in most browsers. The github session cookie is apparently marked as httponly in which case JS wouldn't see it.

It's probably linked to the session's cookie?

I didn't mention the cookie because it's not part of the protocol. It's how Google's servers behave. We don't know what the NK server does.

According to Mozilla...

Firefox is open source, you know. Even if you can't read C++ or understand the Bugzilla comments, you can also just Wireshark it.


Couldn't it be done via cookie?

Their cookies start with "JSESSIONID", so I'm guessing you're right.

It doesn't work by IP address, but by cookie.

But I'm logged in! It shows myname in the corner. So obviously you could get that cookie, right?

It's not the same but aren't the httpOnly cookies kind of serve the same purpose? JS can't read these cookies at all?

If the server supports the HTTP TRACE verb you can still get the cookie. It would be rare, but possible non the less.

Yep but the data in the cookie was provided by the server, which had to already auth you via some means. Like a password, or a client side SSL cert.

FWIW, that's exactly how it works in client-side browsers scripting.

    document.cookie = 'name=value';
next

Legal | privacy