News for hackers. Stuff that matters.
Re:Tales of SugarCRM Security Horrors by hdhzy on Monday April 24, 2017 @04:39AM (#14182765)
I wonder what's the use case for serializing and unserializing objects using php built-in functions. Is this some kind of "I'm too lazy to json encode a subset of properties" or are there some edge cases where one would use this extremely sharp knife?
Re:Tales of SugarCRM Security Horrors by laurent123456 on Monday April 24, 2017 @06:50AM (#14183250)
He mentions that they think it might have a negative effect on performance. But more probably they just don't want to refactor their spaghetti code to properly handle serialized data, so instead they go for quick fixes.
Re:Tales of SugarCRM Security Horrors by stephenr on Monday April 24, 2017 @05:32AM (#14182937)
Sharp knives are the least dangerous if you're cutting something.

A sharp knife will just cut the thing.

A dull/less sharp knife will not cut, causing you to add more pressure, causing the knife to slip, which is when you're more likely to cause yourself harm.

Re:Tales of SugarCRM Security Horrors by hdhzy on Monday April 24, 2017 @06:44AM (#14183232)
Good point.
Re:Tales of SugarCRM Security Horrors by throwanem on Monday April 24, 2017 @06:08AM (#14183077)
There are cases in which one might use it, but no cases in which one should.
Re:Tales of SugarCRM Security Horrors by somebehemoth on Monday April 24, 2017 @08:18AM (#14183627)
If you have completely sanitized data what is the problem with object serialization? Thank you.
Re:Tales of SugarCRM Security Horrors by hdhzy on Monday April 24, 2017 @10:25AM (#14184551)
I think the problem lies somewhere inside "completely sanitized data"."If you have them completely sanitized it usually is not what many would call object serialization (php unserialize) but rather a data format (JSON).
Re:Tales of SugarCRM Security Horrors by throwanem on Monday April 24, 2017 @10:45AM (#14184680)
The only reliable way to sanitize PHP-serialized data is to unserialize it, scrub it, and reserialize it. This poses a nigh intractable chicken-egg problem, and makes a switch to JSON by far a more economical option.
Re:Tales of SugarCRM Security Horrors by mgkimsal on Monday April 24, 2017 @07:25AM (#14183380)
json_encode didn't exist when sugarcrm was initially developed. whether they should have changed it later or not is a different question, but there was nothing else to go with at the start.
Re:Tales of SugarCRM Security Horrors by supergreg on Monday April 24, 2017 @09:27AM (#14184098)
I've seen other projects like Doctrine2 ORM serialize arrays using the built-in serialize function too. I guess/hope they sanitize input beforehand.