Hacker News new | ask | show | jobs
by NGRhodes 977 days ago
> This blog is now STATELESS. The entire post is contained in the URL that you are visiting now. All my "blog" is now is a hard-coded main page that contains links to posts I claim authorship of. Of course the entire post is contained in each of these links.

https://joshcsimmons.com/post/H4sIAAAAAAAA%2F3xV227cRgx911cQ...

9 comments

Yep, Josh has given everyone (apparent) write access to his site.
Awesome - and the first time I've actually had someone "post" on my site.
Watch out: virus/scam/spam sites can detect sites like yours and write tons of redirects, link them somewhere, and use your site's good reputation to get their scams on the home page. This is also a huge problem for redirect services.

If the wrong person publishes the wrong link, you can get your domain banned from Google and tons of other sites as a "security risk", which can spread to your email (if you use @joshcsimmons.com).

It's fine if you don't care about blacklists of course, but this kind of abuse can easily sneak up on you.

You're welcome. :D

The client-side XSS is mostly harmless (assuming you don't have any other sensitive services running with cookies scoped to this domain), although it's technically a persistent XSS, which means it could be indexed by search engines.

But is there a server-side component to this? I noticed that the "disclaimer" is added in the source returned by the server, so I assume there is some code that checks whether the post is present on the home page? If so, that could be dangerous, if there is a bug in that code such that a malicious payload in the URL could get RCE in your server process.

I've just added some defensive programming to the site. Sorry to say. Appreciate that you hacked it with your image onerror, pretty clever.

TBH I haven't thought about most of these things. Nobody typically reads my blogs when I've made them before and this is likely the only interest it will get for quite a while.

lol :) nice fix

Can't promise I won't circumvent it when I've got some time...

https://joshcsimmons.com/post/H4sIAAAAAAAAAyXMQQrCMBCF4b2neO...

Doesn't need to release tools... gzip, base64 and uri encode uh huh.

So if the author fix a small typo in the post, they break all the links to it. The blog is not "stateless", it’s just that its state is stored in the homepage. Having all posts on that page with anchor links would achieve the same thing with shorter links that don’t depend on the content.
It won’t break any existing links. It just means that existing links will still have the typo.
doesn't this mean I could embed salacious material into a link and fool people into thinking the person who owned this website wrote it?
> Anything can be generated here. You could even host your own blog that uses my website as a renderer if you really wanted to. It supports markdown.

> Every post that I want to publicly claim authorship of lives at the root of this site. If you are reading a post that I have claimed it will look like this page. Posts of unknown authorship have a disclaimer at the top of the page.

https://joshcsimmons.com/post/H4sIAAAAAAAA%2F3xV227cRgx911cQ...

(His permalinks are horrible, lol)

>Posts of unknown authorship have a disclaimer at the top of the page.

Problem is, the posts can contain <script> elements. So it's easy to just write a little JavaScript that removes the disclaimer at the top. See this hastily-made, immature example of mine:

https://joshcsimmons.com/post/H4sIABO8LmUC/3VT0W7aQBB85yu2QV...

As it stands, this really isn't the most secure system. Something much more malicious could be injected into this!

This gave me a pretty good laugh. I have some sanitization and guards set up now. TBH I never really expected anyone to visit my blog.
Shouldn’t it be “shat”?

Either way, considering the submission we’re commenting on, the author of the blog may appreciate your humour.

Correct
I was halfway expecting goatse
unfortunately patched now
XSS as a feature, neat
I don't understand how this helps ownership of content? What situation is this trying to avoid? You already "own" your URL if you own your domain?

EDIT: understand you are not the OP btw, just wondering out loud.

The only thing I can think of is if they want to share controversial posts while having the ability to deny that they wrote it (as long as they don’t actually create a link to it from their own site).

It’s not a good use case IMO, but that is all I can think of lol

Huh, cool. I think it's a pretty terrible idea, but I'm glad people are still doing fun/creative things with websites. Keeping the spirit of the early web alive. haha :)
Tranlsation: This guy is insufferable
If you're going to do that, you should at least generate shortened URLs as well.
But then it’s not stateless anymore.
It's not stateless at all because of the main page, so this is more of a weird anti-optimization.
But how does it know whether it should print the pretext?