Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions

@insanitybit
Submissions

comment 4y ago · link · parent

It seems notable that this is a blog post from the perspective of rabbitmq authors, or at least the author of a book about it. It talks very vaguely about one potential implementation of a queue on postgres.

comment 4y ago · link · parent

Perfect! Thanks.

comment 4y ago · link · parent

Got it, thanks. A follow up - is this work funded in any way?

comment 4y ago · link · parent

What's the intended workflow? Would I run a console an all of my rust services, and then when debugging some prod issue connect to it? Or would I flip a switch? Or is it more for CLIs?

Curious to hear, in general, how it's been used.

comment 4y ago · link · parent

That is not really close to what these charges are.

Kail received money and stock directly, not as part of a business or sales exchange. Being flown to a conference where you'll be told the merits of your potential purchase is obviously very different.

Even if Kail had innocently owned stock in a company being evaluated it likely would have been a conflict of interest and they should have stepped away from the evaluation. This happens all the time. As a CEO I can tell you I've had people stop a call partway through because they realize they're conflicted out of the discussion and I'll have to talk to a neutral party.

comment 4y ago · link · parent

> I've wondered if it's not a ploy by cloud vendors and the ecosystem around them to increase peoples' cloud bills. Not only do you end up using many times more CPU but you end up transferring a lot of data between availability zones, and many clouds bill for that.

Disagree. I'd argue that microservices are inherently more cost effective to scale. By breaking up your services you can deploy them in arbitrary ways, essentially bin packing N microservices onto K instances.

When your data volume is light you reduce K and repack your N services.

Because your services are broken apart they're easier to move around and you have more fine grained scaling.

> further increasing lock-in to the managed cloud paradigm if not to individual clouds.

Also disagree. We use Nomad and it's not hard to imagine how we would move to another cloud.

comment 4y ago · link · parent

> what annoys me is they don't really understand why we are having "someone pwned your phone via a series of memory corruption bugs" daily.

No, I understand it. I started out in vuln research and have been in defense for a decade. It's probably fair to even say I'm an expert on it.

I'm going to keep advocating for rust as one the highest ROIs for improving security.

comment 4y ago · link · parent

Well, when combined with an integer overflow at least.

comment 4y ago · link · parent

> As annoying as those Rust evangelists on every single memory corruption bug.

First of all, how dare you!

Second, shoulda used rust ¯\_(ツ)_/¯

comment 4y ago · link · parent

IDK, don't you end up with a bunch of extra costs? Like you're going to literally pay more money because now you have cross region replication charges, and then you're going to pay a latency cost, and then you may end up needing to overprovision your compute, etc.

All to go from, idk, 99.9% uptime to 99.95% (throwing out these numbers)? The thing is when AWS goes down so much of the internet goes down that companies don't really get called out individually.

comment 4y ago · link · parent

It's cool, I also poked at it a bit thinking there was potential. Certainly the Flask article makes some good points about it.

comment 4y ago · link · parent

I honestly just forgot about it

comment 4y ago · link · parent

I don't think this is right. .format() is not running any attacker controlled code. It might be formatting attacker controlled input, but the attacker has no control over the execution.

> o what stop them from spamming

Well I can't imagine how I would actually get that to turn into anything other than just a raw string that gets printed to the screen? Like I said, unless there's an eval somewhere it's not an issue.

edit: OK, I see the problem now. The flask article is a lot clearer.

The attacker can't control execution at all, or even really cause execution. What they can do is get your string to include information it should not - quite a footgun, but nothing close to RCE.

edit2: I maybe see a way this could be bad (if the attacker controls the format string that you call .format on), but I can't actually get it working myself.

So here's the thing. The attack as you've described does not work. Python won't just execute that string, you'll get a KeyError. What you need to do is, given a value provided to the string, call some sort of methods on that value such that you can perform your attack. This should be possible.

edit:

I'm trying to get this attack to work. So far, nah.

My assumptions are:

1. Attacker has full control over format string

2. `requests` is imported already (obviously you could just use the stdlib but I'm lazy)

3. An object or class is passed in

In theory I can construct a class from an object like this:

    Foo.__class__('requests', (requests.Request,), dict())()
    <Request [None]>

But so far that manifests as...

>>> "{0.__class__('requests', (requests.Request,), dict())()}".format(Foo) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: type object 'Foo' has no attribute '__class__('requests', (requests'

It seems that Python does not just naively execute what's inside of this thing.

Similarly,

>>> "{0.__init__((lambda: requests.get('google.com'))())}".format(Foo) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: type object 'Foo' has no attribute '__init__((lambda'

If there's a way to exploit this for actual code execution I can't find it easily.

comment 4y ago · link · parent

Can you elaborate? I don't see how you would exploit Python with a string like that unless there's an `eval` somewhere in Python's logger? I wouldn't exactly put it past the language, for sure, but I'm not aware of that being the case.

The reason this works in the java library is that the library explicitly adds functionality to evaluate the strings that are passed in, and has a meta-language for computing based on those values.

comment 4y ago · link · parent

Go packages its own templating language, doesn't quite scream "minimal".

comment 4y ago · link · parent

Server uptime used to be a point of pride. Now people try to shut them down as often as they can. Funny how things change.

comment 4y ago · link · parent

I'd be interested in hearing from others on this, but typically the way that "inherently unsafe Thing" gets done in rust is that you have an unsafe layer wrapped in a safe layer.

The problem is obviously building the safe layer. Sometimes that's really hard. There are obvious examples already in Rust - like creating a safe API over scoped threads, or io_uring, ghostcells, etc. Some things may not be representable using only safe code in Rust, with no overhead.

Another relevant thing you can't really safely express is FFI. That would be relevant here since there's this VM boundary.

And then you get JITs, which also have tons of security issues.

Idk, I'd be curious to read about this if there are any papers. Maybe the wasm people are thinking about this?

Certainly it's not unreasonable to say that a memory safe JIT'd VM is going to be tough make memory safe.

comment 4y ago · link · parent

Indeed. At one point this was a bigger deal, now it seems that this is the new normal.

Chrome bought a good decade or so of security for itself by leveraging sandboxing, but it seems that attackers have gotten their bearings, so here we are.

I'm curious though. 4102 is a v8 vulnerability. That shouldn't be sufficient to take over a computer. I wonder if there's another 0day for Windows/Linux that it's being paired with?

comment 4y ago · link · parent

Feels harsh to call C programmers "crappy" but ok

comment 4y ago · link · parent

C return code error handling strikes again.

comment 4y ago · link · parent

Interesting. I hadn't heard of FROST or Threshold Signing. It would be helpful to have example use cases divorced from their use cases and focused specifically on how to use these techniques.

comment 4y ago · link · parent

Got it, thanks.

comment 4y ago · link · parent

No, you are still vulnerable, even with just what we know today and we're still finding more ways to break this library.

1. Attackers can still load code in your class path.

2. Attackers can steal environment variables, VM information, system information, etc.

3. The issue isn't specific to LDAP in any way, that was just a particularly brutal way to exploit this vulnerability. There are other ways to achieve RCE.

We may find even more ways to attack this in the future. It is absolutely not a good idea to assume you're safe right now - if you have log4j in your dependency tree, you should keep a close eye on the discourse as it evolves.

edit: I'll just say that I think it's really premature to tell anyone that they're safe.

comment 4y ago · link · parent

Embargoing is very tricky and often harmful. Attackers know how to catch embargo'd vulns, it's often really easy, like in the case of the Linux kernel. If attackers have advanced notice you're only hurting defenders by hiding things from them.

We know that two weeks before disclosure there are attacks using this exploit. Somehow had clearly figured it out, so hiding it was only going to cause problems.

comment 4y ago · link · parent

Does this routing happen before or after log4j would be exploitable? Like if log4j is still running its parser and doing all the crazy stuff, but then routes to some other logger, it doesn't matter.

comment 4y ago · link · parent

It's entirely possible and it's still so early that we're still guessing. But so far some companies have come out to say that they've seen exploitation only as early as a few weeks ago.

Companies likely only started IR in the last week. Breach notifications, which only a minority of companies will bother to send out, will be a few weeks away at the earliest.

comment 4y ago · link · parent

It's still very early, we won't have breach notifications for a while since any attacks would have started in the last few weeks at the earliest, and most would have started last week.

comment 4y ago · link · parent

That would help but it isn't enough. You can still load classes from your class path, and then those would make the calls instead. And log4j does have valid reasons to read/write to files, naturally.

But yes, I think a major issue here is a logging library packaging its own meta language that can trigger side effects.

comment 4y ago · link · parent

> Loading and running a java class is only the most absurd exploitation possibility with log4j.

Uh, yeah, the RCE was very bad. And not a thing with Rust due to not having object serialization.

> you can still slurp any environment variables (or other process information) and send it to any host

Yeah, you can write a logger in rust that does really crazy things like adding environment variables through some sort of parsing of a language construct. That would still be a problem, but a lot less serious. It would probably also be really unidiomatic, but that's a separate story.

comment 4y ago · link · parent

> Most certainly opening the door to a diffetent kind of bugs.

No? There's no law of conservation of bug class or something, you can eliminate bug classes without introducing a new one.

> This mentally of tying bugs to a language demonstrates a very poor understanding of the issues themselves,

No it doesn't.

> and if anything a large impacting bug demonstrates wide adoption of an individual piece, most probably choosen due to its stability or ease of use.

I don't think this has held true historically, and log4j is a good example of this (though there are many others).

> Remember heartbleed?...

A weird point to bring up since heartbleed was an out of bounds memory read.

1
707172
164