Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install.php generates insecure salts #284

Closed
ctrlcctrlv opened this issue Jan 16, 2018 · 10 comments
Closed

install.php generates insecure salts #284

ctrlcctrlv opened this issue Jan 16, 2018 · 10 comments
Assignees
Labels

Comments

@ctrlcctrlv
Copy link
Member

ctrlcctrlv commented Jan 16, 2018

Note: My last write-up was deleted because the user who created the issue rudely deleted the issue which contained the parent comment. When they deleted the issue, my announcement, a child comment, was also deleted. @ipleak102392 acted extremely obnoxiously and trollishly in this regard, so I apologize for his lack of etiquette.

On January 11, 2018, a reporter named Joseph Cox was contacted by Einar Otto Stangvik (@einaros), who via an unnamed source, received a large cache of user IDs from Anon-IB. He discovered a weakness in vichan's code, dating back to 2012, commit c9423a2.

https://www.thedailybeast.com/top-us-government-computers-linked-to-revenge-porn-site

But Einar Otto Stangvik, a security analyst at Norwegian newspaper VG, provided The Daily Beast with a large cache of hundreds of thousands of Anon-IB users’ IP addresses—numerical codes that can show where a user is posting from. A source showed Stangvik a trick for pulling IP addresses from Anon-IB, and Stangvik subsequently wrote a series of scripts to optimize the process and successfully grab the data. Stangvik said the data was obtained legally, and he also helped The Daily Beast analyze the results.

Thanks partly to Moore's law, and the use of an insecure PHP randomness function (rand), @einaros was able to use, I assume, rainbow tables to figure out the salt, then he was able to simply check the SHA1 hashes of the salt he figured out appended to all IP addresses (all 32-bit values), and he was able to get the IPs attached to all posts on Anon-IB.

I contacted him asking how he did it, and at first got no response, but after some insistence he, along with his mysterious source "M", helped me figure out the above.

I will soon:tm: push a commit which will patch this issue for new installations of vichan. However, it is impossible for me to do this in a clean way for existing vichan users, because if I have install.php overwrite your tripcode salt, all tripcodes on your board will change; and it's quite possible that you have a secure tripcode salt.

So, therefore, I advise all administrators of vichan imageboards to immediately do any of the following if they are using the secure tripcode salt generated by install.php, which is the default. If you don't know what this means, you are affected.

  1. In inc/instance-config.php, reset $config['cookies']['salt'] and $config['secure_trip_salt'] to a long random string. You can generate this string via many methods: just make sure it is cryptographically secure. The best thing to do is use the command < /dev/random tr -dc [:print:] | head -c${1:-128};echo;. If that is unavailable to you, perhaps use random.org or pwgen -s.
  2. If you do not want to do (1), because it will make all secure tripcodes (trips starting with ##) on your board change, you must disable user IDs on all boards on your site. Note that because of this bug it is now much easier to crack secure tripcodes, so I really recommend (1).

If you are a user of a vichan imageboard, please show your admin this warning. Infinity based imageboards, because they do not have install.php, and expect users to set their salts manually as shown above, are not affected. But this is a good reminder to them to use secure salts - don't just use the default in inc/config.php!

@ctrlcctrlv ctrlcctrlv added the bug label Jan 16, 2018
@ctrlcctrlv ctrlcctrlv self-assigned this Jan 16, 2018
@Cipherwraith
Copy link

For anybody curious, 8chan uses a long random string for a salt and should be unaffected by this security bulletin.

@StephenLynx
Copy link

Sorry for crashing here with a completely unrelated comment, but how would be a reliable way to contact both or you?

@odilitime
Copy link

openib isn’t affected I take it since it’s based on infinity?

@ctrlcctrlv
Copy link
Member Author

@StephenLynx My email can be found in README.md.

@odilitime Correct - infinity has a very different install procedure than vichan. vichan installation is based on version numbers, while infinity is rolling release, and you install it by initializing the database yourself, installing all the configs yourself and generating the salts yourself (as advised in the comments of infinity's inc/secrets.php). Infinity and OpenIB have no install.php, because I removed it years ago from infinity since I did not want to maintain a stable release.

@ctrlcctrlv
Copy link
Member Author

I'm going to leave this issue open for 30 more days because 693fa1b is only a partial fix. After that, I will assume that all existing users have seen this, and I will close it.

@ctrlcctrlv ctrlcctrlv reopened this Jan 29, 2018
@noirscape
Copy link

noirscape commented Jan 29, 2018 via email

@goosehub
Copy link

@ev1l0rd if it's only on your local network, and your local network is secure, then security vulnerabilities in software should almost never matter, in theory at least, and unless the software itself is malicious of course.

@noirscape
Copy link

noirscape commented Jan 29, 2018 via email

@ctrlcctrlv
Copy link
Member Author

@ev1l0rd I have no idea why you would run vichan on your local network, but you are not affected, no. Only instances which are online are affected, since this is an IP leak issue.

@noirscape
Copy link

@ctrlcctrlv - Curiosity + liking to mess around with it mostly. But thanks for the clarification. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants