News for hackers. Stuff that matters.
Re:The “security.txt” proposal reached last step in the IETF... by linsomniac on Wednesday December 11, 2019 @04:39PM (#21767059)
I love this idea, though I'm not sure I want my password manager executing arbitrary regexes it finds on the Internet.
Re:The “security.txt” proposal reached last step in the IETF... by saagarjha on Wednesday December 11, 2019 @04:56PM (#21767190)
If you restrict it to “formal” regular expressions you’ll stay out of “arbitrary code executing on a Turing machine”.
Re:The “security.txt” proposal reached last step in the IETF... by wahern on Wednesday December 11, 2019 @05:12PM (#21767329)
Regular expression engines are notoriously buggy. You definitely wouldn't want to pass random expressions to libpcre.

Web browsers are already running random expressions from the internet, but their regex implementations have proven the rule by being fodder from exploit writers. In any event, requiring a password manager to pull the engine from Firefox or Chrome wouldn't be cool. They're more likely to use libpcre or re2, but see above.

The NAPTR DNS record type uses regular expressions for domain rewriting: https://en.wikipedia.org/wiki/NAPTR_record Not many DNS libraries support that record type as it adds alot of problematic bloat.

Re:The “security.txt” proposal reached last step in the IETF... by saagarjha on Wednesday December 11, 2019 @05:18PM (#21767374)
libpcre is exactly the implementation I’m not talking about, because it supports too much. I think re2 doesn’t do backtracking, so it’s probably a better choice.
Re:The “security.txt” proposal reached last step in the IETF... by wahern on Wednesday December 11, 2019 @05:25PM (#21767434)
You can still easily blow up memory with unions, which makes it easy to lock up Linux, which notoriously performs poorly under memory pressure.
Re:The “security.txt” proposal reached last step in the IETF... by lilyball on Wednesday December 11, 2019 @05:45PM (#21767606)
A non-backtracking regex engine like re2 should be linear with respect to the regex size and can be configured with a memory budget.
Re:The “security.txt” proposal reached last step in the IETF... by wahern on Wednesday December 11, 2019 @06:01PM (#21767708)
The number of DFA states can explode exponentially. It's a real problem, especially if you're compiling untrusted expressions off the internet.

Evaluation is linear, but you're just evaluating your own password. In this scenario, it may make sense to just use a simple backtracking implementation, though as you alluded to early there aren't many simple ones around.

Re:The “security.txt” proposal reached last step in the IETF... by pjscott on Thursday December 12, 2019 @01:19AM (#21769687)
RE2, at least, will fall back to an NFA-based matcher if things get too pathological.
Re:The “security.txt” proposal reached last step in the IETF... by saagarjha on Wednesday December 11, 2019 @05:41PM (#21767568)
Just set a memory limit on the process.
Re:The “security.txt” proposal reached last step in the IETF... by daxelrod on Wednesday December 11, 2019 @07:20PM (#21768224)
Counterpoint: if you allow your browser to run JavaScript, it’s already executing arbitrary regexes it finds on the Internet.
Re:The “security.txt” proposal reached last step in the IETF... by closeparen on Wednesday December 11, 2019 @07:30PM (#21768273)
The browser is, the passwords manager is on the other end of an IPC mechanism with a hopefully small and well-defined interface.
Re:The “security.txt” proposal reached last step in the IETF... by daxelrod on Saturday December 14, 2019 @10:25AM (#21789905)
My point is that it is possible for your password manager to sandbox regex execution at least as well as your browser does.

I totally agree with your concerns about scope creep increasing the attack surface.

Re:The “security.txt” proposal reached last step in the IETF... by ben509 on Thursday December 12, 2019 @07:38AM (#21771324)
But it's not executing a match, it's creating a random password picker. That's exactly equivalent to parsing the pattern where the actions on terminals are to generate random characters.