News for hackers. Stuff that matters.
Re:On Python security amidst recent Rails/YAML vulnerabilities by untog on Sunday February 03, 2013 @04:28AM (#5159193)
I think load and dangerous_load is a wonderful paradigm for API design.

It is, but I think it ignores the reality of API design. Who would ever start with dangerous_load? If you knew it was dangerous, you'd probably fix it. No, you start with load(), then find out it's dangerous afterwards. The fix will be a breaking change, so you make safe_load().

"You should replace load()!", I hear you cry. But that removes backwards compatibility. And people don't update legacy software. So then old software becomes vulnerable to who knows how many other security problems because of it's obsolescence.

Re:On Python security amidst recent Rails/YAML vulnerabilities by vog on Sunday February 03, 2013 @04:48AM (#5159228)
> ... ignores the reality of API design. Who would ever start with dangerous_load?

When I wrote the Texcaller library, which simplifies compiling (La)TeX code, I disabled dangerous features such as "write18" from the very beginning.

I you don't take basic elements such as "secure/unsecure" variants into account, you're no really doing API design. You then just have a historically grown API, which is not necessarily bad in itself, but doesn't qualify to be called API design.

> But that removes backwards compatibility. And people don't update legacy software. So then old software becomes vulnerable to who knows how many other security problems because of it's obsolescence.

In that case, at least only old hard-to-update legacy software is affected, and not all the other (good, mostly well-written) software that is written today and in the future.

Of course, don't forget to increase the major version number, as for every API change that breaks backward compatibility.

Re:On Python security amidst recent Rails/YAML vulnerabilities by untog on Sunday February 03, 2013 @05:04AM (#5159252)
doesn't qualify to be called API design.

True. I should have said the reality of the difficulty of API design.

In that case, at least only old hard-to-update legacy software is affected, and not all the other (good, mostly well-written) software that is written today and in the future.

I like the sentiment, but I can't agree with it. In an ideal world all critical systems would always be kept up the date, but that doesn't happen. Has Python 3 usage overtaken 2.x yet?

Re:On Python security amidst recent Rails/YAML vulnerabilities by ufo on Sunday February 03, 2013 @10:10AM (#5159854)
> Who would ever start with dangerous_load?

Haskellers. This is why you get lovely long and alarming names like `unsafePerformIO`

Re:On Python security amidst recent Rails/YAML vulnerabilities by rpearl on Sunday February 03, 2013 @10:26AM (#5159895)
Which, since it explicitly breaks type safety (you can write coerce :: a -> b with it), is an appropriate name for that function.
Re:On Python security amidst recent Rails/YAML vulnerabilities by mercurial on Sunday February 03, 2013 @05:38PM (#5161516)
On the other hand, for serialization/deserialization of a data type from format X to Haskell, you would not need a "dangerous_load" function, since the code would be pure.