News for hackers. Stuff that matters.
Re:Show HN: Newsboard – A Hacker News Clone by jenoer on Tuesday August 25, 2020 @12:16PM (#24272904)
@robdelacruz: I have a few security-related findings for you that you might want to take a look at:

- I can inject any JavaScript in Titles, Tags and possibly other locations.

- By manually changing the value of the `userid` cookie, I can log in as any user ("1" for admin). This also allows me to access the admin section of the website.

- It's highly recommended to enable "HttpOnly" for session cookies. (Secure and SameSite should also be more strict if the application allows it)

Other remarks:

- There should be a limit on the length of submission titles, these are close to infinite it seems.

Edit: It seems others are completely defacing the board by using these tricks. I just want you to know that it's not me.

Re:Show HN: Newsboard – A Hacker News Clone by robdelacruz on Tuesday August 25, 2020 @10:43PM (#24278549)
Thanks for the bug reports. Much appreciated. Will take a look at these one by one. Hopefully to get the site back up and running.

Source code is at: https://github.com/robdelacruz/newsboard

Re:Show HN: Newsboard – A Hacker News Clone by zxcvbn4038 on Tuesday August 25, 2020 @02:13PM (#24274247)
This is why we can’t have nice things! Citibank had the same issue five or six years ago where once you logged in you could change the URL to any account. I think they lost something like $36 million before the hole was plugged.
Re:Show HN: Newsboard – A Hacker News Clone by willio58 on Tuesday August 25, 2020 @01:08PM (#24273509)
This is hilarious, people are having a javascript alert conversation on this site.
Re:Show HN: Newsboard – A Hacker News Clone by krapp on Wednesday August 26, 2020 @08:24PM (#24288877)
It looks like you're using HTML form maxlength attributes to determine the maximum length for elements. I hope you're also validating that on the server somehow, because of course anyone can simply delete those before posting.

Remember, no one even has to go through your form to make a POST request to one of your endpoints (unless maybe you're using CSRF tokens, which you don't seem to be). Never assume that what you send to the user has any relationship to what they send back, and never validate on the front end.

Re:Show HN: Newsboard – A Hacker News Clone by robdelacruz on Wednesday August 26, 2020 @10:13PM (#24289514)
You're right, there's no validation on the server. Need to fix those.

As quick fix to get the site up and running again, I just trimmed off any overly long title or cat beyond a certain limit of chars.

Re:Show HN: Newsboard – A Hacker News Clone by robdelacruz on Tuesday August 25, 2020 @10:50PM (#24278583)
(OP here) Hi guys, thanks for checking out newsboard.

Source code is here https://github.com/robdelacruz/newsboard

I will look into fixing the security bugs to get the site back up and running. Feel free to check out the code.

If you have time to waste, check out my "unix fortune2" web page to get your unix fortunes. It's a clone of 'unix fortune':

http://fortune2.robdelacruz.com/

Re:Show HN: Newsboard – A Hacker News Clone by robdelacruz on Wednesday August 26, 2020 @10:54AM (#24283012)
Re:Show HN: Newsboard – A Hacker News Clone by brian_herman__ on Tuesday August 25, 2020 @11:59AM (#24272665)
i think someone figured out how to include their own javascript inside the website i got two alert boxes when i opened the page.
Re:Show HN: Newsboard – A Hacker News Clone by freetonik on Tuesday August 25, 2020 @07:51AM (#24270395)
Looks neat and tidy. Is it open source?
Re:Show HN: Newsboard – A Hacker News Clone by iKevinShah on Tuesday August 25, 2020 @09:33AM (#24271134)
The first link on the demo is this - https://github.com/robdelacruz/newsboard

Seems like the source

> newsboard - a bulletin board and bookmark sharing site (inspired by HackerNews)

Re:Show HN: Newsboard – A Hacker News Clone by robdelacruz on Tuesday August 25, 2020 @10:46PM (#24278566)
OP here. Right, that's the source:

https://github.com/robdelacruz/newsboard

I used plain css from scratch to keep it small. I tried to copy the HackerNews look, but using Flex instead of Tables.

Re:Show HN: Newsboard – A Hacker News Clone by DarthGhandi on Tuesday August 25, 2020 @11:48AM (#24272551)
It looks like it's using this hugo theme but I may be wrong.

https://themes.gohugo.io/hugonews/

Re:Show HN: Newsboard – A Hacker News Clone by whinvik on Tuesday August 25, 2020 @12:19PM (#24272942)
Is the source for HN available?
Re:Show HN: Newsboard – A Hacker News Clone by detaro on Tuesday August 25, 2020 @12:23PM (#24273001)
A older version/variant is part of the Arc sources (http://www.arclanguage.org/ ), but the code running the actual site is not.
Re:Show HN: Newsboard – A Hacker News Clone by pcdoodle on Tuesday August 25, 2020 @09:52AM (#24271335)
Very cool!
Re:Show HN: Newsboard – A Hacker News Clone by maps7 on Tuesday August 25, 2020 @08:12PM (#24277753)
You should probably take this down now