Deserialization Issues Also Affect Ruby -- Not Just Java, PHP, and .NET (zdnet.com)
An anonymous reader writes: The Ruby programming language is impacted by a similar "deserialization issue" that has affected and wreaked havoc in the Java ecosystem in 2016; an issue that later also proved to be a problem for .NET and PHP applications as well. Researchers published proof-of-concept code this week showing how to exploit serialization/deserialization operations supported by the built-in features of the Ruby programming language itself.
"Versions 2.0 to 2.5 are affected," researchers said. "There is a lot of opportunity for future work including having the technique cover Ruby versions 1.8 and 1.9 as well as covering instances where the Ruby process is invoked with the command line argument --disable-all," the elttam team added. "Alternate Ruby implementations such as JRuby and Rubinius could also be investigated."
The deserialization issues can be used for remote code execution and taking over vulnerable servers. While .NET and PHP were affected, it was Java until now that has faced the biggest issues with deserialization, earlier this year, Oracle announcing it was dropping deserialization support from the Java language's standard package.
"Versions 2.0 to 2.5 are affected," researchers said. "There is a lot of opportunity for future work including having the technique cover Ruby versions 1.8 and 1.9 as well as covering instances where the Ruby process is invoked with the command line argument --disable-all," the elttam team added. "Alternate Ruby implementations such as JRuby and Rubinius could also be investigated."
The deserialization issues can be used for remote code execution and taking over vulnerable servers. While .NET and PHP were affected, it was Java until now that has faced the biggest issues with deserialization, earlier this year, Oracle announcing it was dropping deserialization support from the Java language's standard package.
Sun really did a disservice with their serialization API. Developers think serialization is magic. I worked with several clients who needed custom serialization/deserialization. They usually believed that custom deserialization had to use the Java APIs but that is untrue. A good development framework can handle weak references, transience, etc. most freeware serialization frameworks are not sophisticated or reliable.
Because, if so, that's a big deal. Very big. The biggest.
XML was supposed to fix all this!
And we all know, XML is like violence: if it doesn't fix the problem you're not using enough of it.
Serialisation and deserialisation happens when developers get lazy and/or the original architects of the system designed a shitty appmodel. Or none at all. You see this nice and clearly in PHP CMSes such as Expression Engine or WordPress.
It goes like this:
Check out the model, see bunch of crap, think: "Oh I know, I'll just serialize my stuff and dump it into a single field." Newer stuff in WP is full of this and it doesn't help that this is tacked on to a baaad application model with some really shitty DBAL mechanisms that quickly grow to 2-digit amounts of SQL statements being executed per API call and an ERD designed on crack.
The truth of the matter is: If you don't take total control of your data every step of the way you are bound to be screwed when an exploit like this crops up. Simply serializing is the exact opposite of taking control. And taking control is basically impossible if you don't know how to design your app or its DB.
Whenever I see serialized data lying around in persistence, I know that someone further up didn't do his job.
My 2 eurocents.
We suffer more in our imagination than in reality. - Seneca
It is only a problem if you are careless. I always checksum the serialized data, then encrypt it and prepend the checksum, then checksum the result, and if any of it doesn't check out, I don't even bother.
Nothing's wrong with serialization and deserialization, it is good old incompetence that corrupts everything.
"Magic" is how XML was supposed to fix all encoding (and therefore, de/ser) problems.
Of course it didn't. So the same "developers" came up with a new trick: JSON. It's simpler. But it's still a crock. Built on the same premise, in fact.
The problem is a lot deeper, and you and your clients are only scratching the surface. (As am I, but I actually like this sort of bit twiddling.) If you're thinking in frameworks, you're doing it wrong. You actually positively need to pick apart and also properly generate a specific wire format? Then you do it all yourself and all you get is the basic read() and write(). Or perhaps you use buffered input and you get to use getchar(). But again that's all you're getting.
The rest you bring youself, which must include both sides and some scaffolding to run automated testing. Probably including pumping gigabytes of random data through the thing and checking what comes out is the same as what came in.
I know nothing about sun's api, but this isn't (just) on sun's head. It's on everyone who just plain doesn't understand that input and output means data is crossing a border (outside: not your program, so not your jurisdiction, and inside: your program, your responsibility) and you need to be careful about what comes in and what goes out. "XML" is a prime example of the "oh! I know! We'll cook up a framework!" non-thinking that inevitably leads to fscking things up royally. But it's a very popular pastime with certian... people with a habit of "magical framework thinking". In kids it's cute. In webmonkeys, not so much.
Then again, this is a rather specialist topic. You may find you really do need specialists to do it and not let the rest of the code monkeys near the innards of the de/ser apparatus. The problem, of course, is that you can't have a "universal" de/ser thingamajig (witness all the RPC things that invariably have their own), and you shouldn't rely on your compiler writers to provide it to you. Not even google: As cute as "packet buffers" is, it still sucks in very google-y interesting ways.
How is this news?
If you don't verify your data and rely on built in functions to automagically do it for you, you're going to have a bad time.
Most developers are surrounded by non-IT people who consider them geniuses. So the "genius"of course thinks he is also a security expert. After all, he knows how to devise a strong password, what else could be hard ?
...think you should never limit anything by formal rules. Every social scientist should be able to program the control units for your ABS brake.
If you die, your wife and 14 year old son can avenge you in the wonderful world of Liberats.
This has nothing do with serialization, which is just as much as serialization when written by hand. This has something to do with trusting inputs. One should not trust input that the user can control. If one only saves internal records to disk, automated serialization is welcome.
And in general, it would be good if programmers stop hating processes for automating code. The whole point of coding, and programming, is automating things. If you insist on doing things by hand, why not try your hands at doing construction work or something that actually CAN'T be automated?
Avantgarde Hebrew science fiction
Even leftists voted for Trump, because Hillary stood only for two things : identity politics and war.
I say this as a Euro wimp, redder than the USSR flag and as we pick up degeneracy a decade or less after the US does : before the cunt-in-chief, I didn't think anti-white racism was a real thing. That got worse after the election.
Let's remember what the cunt-in-chief shares with Obama : responsibility for the deaths in Libya, Syria and Yemen, as well as the migration crises and the bombings and attacks in Europe. But no she has moral superiority because vote for me I have a cunt. The equivalent would have been to see Hitler's small dick and declare him a saint and celebrate him because it's proof he was a victim.
Also, US presidents always make sure to kill one million, maybe two millions max (or three in earlier times) because if they get to six millions some people will notice and then someone will lose their ultra supreme six million victim status.