HNHacker News
TopNewBestAskShowJobs

nbpoole

2,035 karma · joined November 2, 2010

Web application security enthusiast. Currently a Security Engineer at Facebook. Formerly a security consultant for Matasano Security. My posts and comments do not reflect the opinions or views of my employer.

Blog: https://nealpoole.com/blog/

Twitter: https://twitter.com/NealPoole

Contact me: https://nealpoole.com/blog/contact/

submissionscomments
nbpoole··on Ask HN: Feedback on project
http://whatportis.com/index.php?port=%27

http://php.net/manual/en/security.database.sql-injection.php

nbpoole··on H.R.1981, the end of online privacy as we know it.
IP addresses were already preserved:

> (E) telephone or instrument number or other subscriber number or identity, including any temporarily assigned network address; and

http://www.law.cornell.edu/uscode/18/usc_sec_18_00002703----...

The new law explicitly amends the previous law so that IP address records are stored for 18 months, as opposed to 90 days.

nbpoole··on H.R.1981, the end of online privacy as we know it.
To be clear, the full text of that portion of the legislation says:

---

(a) In General- Section 2703 of title 18, United States Code, is amended by adding at the end the following:

`(h) Retention of Certain Records- A provider of an electronic communication service or remote computing service shall retain for a period of at least 18 months the temporarily assigned network addresses the service assigns to each account, unless that address is transmitted by radio communication (as defined in section 3 of the Communications Act of 1934).'.

(b) Sense of Congress- It is the sense of Congress that records retained pursuant to section 2703(h) of title 18, United States Code, should be stored securely to protect customer privacy and prevent against breaches of the records.

---

In other words, it amends the existing language [0] which says (in part):

---

A provider of electronic communication service or remote computing service shall disclose to a governmental entity the—

(A) name;

(B) address;

(C) local and long distance telephone connection records, or records of session times and durations;

(D) length of service (including start date) and types of service utilized;

(E) telephone or instrument number or other subscriber number or identity, including any temporarily assigned network address; and

(F) means and source of payment for such service (including any credit card or bank account number),

of a subscriber to or customer of such service when the governmental entity uses an administrative subpoena authorized by a Federal or State statute or a Federal or State grand jury or trial subpoena or any means available under paragraph (1).

[snip]

(f) Requirement To Preserve Evidence.—

(1) In general.— A provider of wire or electronic communication services or a remote computing service, upon the request of a governmental entity, shall take all necessary steps to preserve records and other evidence in its possession pending the issuance of a court order or other process.

(2) Period of retention.— Records referred to in paragraph (1) shall be retained for a period of 90 days, which shall be extended for an additional 90-day period upon a renewed request by the governmental entity.

---

So you're 100% right: the name, address, etc information is ALREADY being preserved. This legislation mandates that records of IP addresses linked to accounts be stored for at least 18 months, whereas before they would have been retained for 90-180 days.

---

[0]: http://www.law.cornell.edu/uscode/18/usc_sec_18_00002703----...

nbpoole··on New DNS hijacking technique exploits RAM errors
> Normally a couple hundred IPs a day will visit popular bitsquatted destinations. #blackhat

https://twitter.com/#!/dakami/status/98910873044791297

nbpoole··on Zero Day Vulnerability in many Wordpress Themes
You're confusing the issue. This isn't about SSH versus FTP: it's about whether or not the Apache user running your website can also write to the filesystem inside of your document root. The Wordpress update feature is actually able to use FTP as the means of updating the site.
nbpoole··on Zero Day Vulnerability in many Wordpress Themes
No. The timthumb.php script can be accessed directly by unauthenticated users.
nbpoole··on Facebook Offers $500 Bounty for Reporting Bugs: Why So Cheap?
+1

At best, a bounty program gives me the incentive to look more closely at a particular website / application. But I've submitted plenty of vulnerability reports to companies that don't have bounty programs.

What this bounty really means: if you like finding and responsibly reporting security vulnerabilities, you now have one more reason to spend time doing so on Facebook.

nbpoole··on Facebook Offers $500 Bounty for Reporting Bugs: Why So Cheap?
Why so cheap? Because $500 is the base, not the maximum. $500 is the base reward for Google and Mozilla's web bounty programs as well. Another similar bounty program, from CCBill, lists a maximum payout of $500 (although I can confirm that they can and will issue higher rewards under certain circumstances: https://twitter.com/#!/williamlbell/status/97379423816384512)

[Note: I've participated in the bounty programs for Google, Mozilla, and CCBill. I've submitted security vulnerabilities to Facebook as well prior to this bounty program]

nbpoole··on SQL Injection Pocket Reference (Google Doc)
Whoops. I totally misunderstood what that part of the guide was trying to accomplish. In case anyone makes the same mistake I did, the suggestion is to get the column count by reading the error message. I'm used to not being able to read the error.
nbpoole··on SQL Injection Pocket Reference (Google Doc)
There's actually another issue that I missed before. SELECT * returns all of the columns in the table: you can't compare that to a scalar.

Tested on MySQL 5.5 on OS X:

    mysql> use test
    Database changed

    mysql> show tables;
    Empty set (0.00 sec)

    mysql> create table test (id int(10) unsigned not null auto_increment, name varchar(10), primary key(id));
    Query OK, 0 rows affected (0.13 sec)

    mysql> insert into test (name) values ("Bob");
    Query OK, 1 row affected (0.02 sec)

    mysql> select * from test;
    +----+------+
    | id | name |
    +----+------+
    |  1 | Bob  |
    +----+------+
    1 row in set (0.00 sec)

    mysql> select * from test WHERE (select * FROM test) = 1;
    ERROR 1241 (21000): Operand should contain 2 column(s)

    mysql> select * from test WHERE (select 1 FROM test) = 1;
    +----+------+
    | id | name |
    +----+------+
    |  1 | Bob  |
    +----+------+
    1 row in set (0.00 sec)

    mysql> insert into test (name) values ("Frank");
    Query OK, 1 row affected (0.00 sec)

    mysql> select * from test WHERE (select 1 FROM test) = 1;
    ERROR 1242 (21000): Subquery returns more than 1 row
nbpoole··on SQL Injection Pocket Reference (Google Doc)
Noticed a small mistake in the MySQL section:

    Error Based:
        AND (SELECT * FROM SOME_EXISTING_TABLE) = 1
Unless SOME_EXISTING_TABLE has no more than one row, that query will fail. See http://dev.mysql.com/doc/refman/5.0/en/comparisons-using-sub...:

"For a comparison of the subquery to a scalar, the subquery must return a scalar."

It's easy to fix: just add LIMIT 1 to the end of the sub-select.

---

This document is very useful. I've been doing web app security for a while and I haven't run across some of these techniques before (eg: PROCEDURE ANALYSE()). I didn't realize that PDO_MYSQL allowed for multiple queries by default either (although it makes sense, since historically other RDBMS have supported it).

nbpoole··on Airbnb Nightmare: No End In Sight
"It's not a woman, it's a man. He even cleared that up in this article."

From the blog post:

"I do exist. I am a real person using a nickname my parents stuck me with long ago. I do not work for the hotel industry, though I admit I love a Four Seasons as much as the next girl. Oh and on that note, I am female."

Sounds like a woman to me.

nbpoole··on Redis 2.4 will be released tomorrow
He didn't say "it never could": he said "it never really could." The VM feature was always experimental.

If you're interesting in reading more, there's some good discussion at http://news.ycombinator.com/item?id=2606096

nbpoole··on Ask HN: What's the coolest PHP snippet you know?
http://www.reddit.com/r/programming/comments/dst56/today_i_l...

One of the code examples from here might be good if you're looking to scare people :-P

Edit: I have a more serious suggestion. Why not pick 8 lines from your own codebase?

nbpoole··on I just discovered major security flaws in my web store
This is a fairly common issue when people are integrating with third party payment providers:

- http://checkout.google.com/support/sell/bin/answer.py?answer...

- https://payments.amazon.com/sdui/sdui/helpTab/Amazon-Simple-...

- http://letsearndollar.blogspot.com/2009/07/change-any-paypal...

nbpoole··on Start-up picks new Web address after hijacking
Name.com (one of the registrars mentioned in the blog post) offers two-factor authentication: http://www.name.com/services/namesafe. It's one of the reasons I really like them as a registrar :-)
nbpoole··on Most people have no idea what the word hacker means
http://en.wikipedia.org/wiki/Tech_Model_Railroad_Club

"The Tech Model Railroad Club (TMRC) is a student organization at the Massachusetts Institute of Technology (MIT), and one of the most celebrated model railroad clubs in the world, because of its historic role as a wellspring of hacker culture."

nbpoole··on Understanding Linux CPU Load - when should you be worried?
> I can't comment on the original article. Are comments closed, or am I dumb?

It was posted in 2009, so the comments are probably closed :-)

nbpoole··on Short array syntax finally in PHP 5.4
They're notices, not warnings. They can be disabled via a simple call to the error_reporting function.

I fundamentally disagree with you though. For me, notices are very useful for identifying typos and other coding mistakes that can lead to incorrect behavior.

Consider the following lines of code:

    $user_info = array(
            'id'            => 1,
            'username'      => 'nbpoole',
            'is_guess'      => false
    );

    if (!$user_info['is_guest'])
    {
            echo 'Member stuff';
    }
When I run that script with error_reporting set to E_ALL, I get an "undefined index" notice pointing me to the line where I do the comparison: at that point, I can track down where in my code I misspelled the word guest. Without the notice, I might not immediately realize that the 'is_guest' index was mis-spelled somewhere.
nbpoole··on Short array syntax finally in PHP 5.4
https://wiki.php.net/todo/php54
nbpoole··on Short array syntax finally in PHP 5.4
With the removal of bad legacy features like register_globals, magic_quotes_gpc, and safe_mode combined with new features like array de-referencing and traits, I'm really excited for PHP 5.4. :)

For anyone who's curious, here's a list of the changes in 5.4 alpha 1: http://www.php.net/releases/NEWS_5_4_0_alpha1.txt

nbpoole··on Short array syntax finally in PHP 5.4
http://svn.php.net/viewvc?view=revision&revision=300266

http://www.php.net/archive/2011.php#id2011-06-28-1

It's in PHP 5.4 alpha as well ;)

nbpoole··on Fusker - a NodeJS security system that attacks back
Not to belabor the point, since other people have assessed this library quite well, but:

1. Detecting XSS by looking for '<', '>', '(', or ')' in the URL is a very naive approach. It can be bypassed fairly easily and many XSS vectors could have payloads constructed that bypass this filter. Also, you're likely to get some false positives for a certain subset of applications, since parenthesis have legitimate uses.

2. I'm not sure on what basis the first part of the CSRF protection is valid or what it's trying to protect. Is it looking for an Accept header for application/json?

3. The second part of the CSRF protection, which looks at the referer header, seems buggy and easy to bypass. What is it trying to accomplish? Right now, it seems like it blocks POST requests where the referer is set and contains the server's hostname (which valid requests will have).

4. Detecting CSRF by looking for non-GET/POST methods is a bad idea unless your application specifically constrains itself to those two methods. Many modern applications are using PUT and DELETE internally for routing purposes.

5. Detecting LFI in the URL by looking for ../ is, again, naive (although less likely to lead to false positives than the XSS testing).

6. The most "objectionable" part here seems to be the "fight back" options. There are definitely some legitimate concerns about an attacker being able to get a targeted user banned from a site (after all, you can't distinguish between a failed CSRF that an attacker is sending and a failed CSRF that an attacker tried to convince a target to send). For the most part though, I don't think they're a big deal for a small, independent site that opts-in to them: they sound a lot like the Miserable Users mod for VB (http://www.vbulletin.org/forum/showthread.php?t=93258)

That being said, no system that operates like a WAF is going to be perfect. The idea of a mod_security-like system for node.js is very cool though. I just think the way you tried to launch it here, with no indication on GitHub or otherwise that it's not a finished product, has led to some backlash. :-)

nbpoole··on Remove any Site From Google (even if you don't control it)
Because the security email address is not a place for bug reports: it shouldn't be ranking for that query. If it did, the team would just be swamped with "bug reports" ;)

Try searching for "google report security" or "security vulnerability google" and you'll find the right information.

nbpoole··on A lesson in timing attacks
It was posted almost two years ago. While duplicate posts can be an issue, having well-written, useful content show up twice in two years doesn't seem excessive to me.

There was some helpful Q&A in that old discussion though, so it's good that you linked to it.

nbpoole··on Ask HN: Who's seeking work?
http://news.ycombinator.com/item?id=2719083

http://news.ycombinator.com/item?id=2719028

nbpoole··on Ruxum: Wall Street-Level Security Comes to Bitcoin
https://secure.trust-guard.com/certificates/secure.trust-gua...

Apparently they don't run their security scanner against their own website ;-)

nbpoole··on Ruxum: Wall Street-Level Security Comes to Bitcoin
Yes, with a lot of vague, generic statements.

"Security measures have been built into the design and setup of our infrastructure." tells you absolutely nothing. Neither does "Disasters are never nice events and we hope they don’t happen. We also expect one will happen and have plans to recover when it does." (although it's not strictly a security issue either).

nbpoole··on Ruxum: Wall Street-Level Security Comes to Bitcoin
> Just passed a 47,000 point security check by an independent 3rd party. Our platform is also now PCI DSS compliant. Daily tests starting now

https://twitter.com/#!/ruxum/status/86827701381496833

In other words, https://secure.trust-guard.com/certificates/www.ruxum.com

Personally, I don't consider that to be "Wall Street-Level Security."

nbpoole··on Skype XSS vulnerability
> skype declares my bug as "minor issue", but skype doesn't handle domain scope properly, hence it is possible to own victim's machine

https://twitter.com/#!/noptrix/status/91910866538217472

And the HN discussions about the previous vulnerability: http://news.ycombinator.com/item?id=2522466 and http://news.ycombinator.com/item?id=2522453

← PreviousPage 5 of 15Next →