News for hackers. Stuff that matters.
Re:Show HN: Replace CAPTCHA with Proof-of-Work by a1a on Wednesday June 25, 2014 @05:16PM (#7946808)
$url = 'https://hashcash.io/api/checkwork/' . $_REQUEST['hashcashid'] . '?apikey=[YOUR-PRIVATE-KEY]'; $work = json_decode(file_get_contents($url));

Pretty sure this code is vulnerable to local file inclusion. Running file_get_contents on unchecked user input is a terrible idea, even more so coming from a "security solution".

Re:Show HN: Replace CAPTCHA with Proof-of-Work by 0x0 on Wednesday June 25, 2014 @07:25PM (#7947324)
How do you turn a prefix of "https://hashcash.io/" into a local file inclusion?
Re:Show HN: Replace CAPTCHA with Proof-of-Work by hippich on Wednesday June 25, 2014 @05:36PM (#7946878)
It was quick and dirty example on how to use it. Frameworks usually expose builder function where you can pass query as and array/hash and that should be used. Do you have better example which will be clear about what happening and use pure PHP?
Re:Show HN: Replace CAPTCHA with Proof-of-Work by ars on Wednesday June 25, 2014 @07:18PM (#7947308)
Add:

    if(strspn($_REQUEST['hashcashid'], 'abcdef0123456789-') !=
       strlen($_REQUEST['hashcashid'])
         die('Invalid character.');