News for hackers. Stuff that matters.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by orf on Tuesday September 14, 2021 @09:20PM (#28533967)
The apparent fix: https://github.com/microsoft/omi/commit/4ce2cf1cb0aa656b8eb9...

Looks like a standard, absolutely gigantic C/C++ project that re-invents absolutely everything including an event loop, http server, XML parser, a C++ tool to generate C code to create a “str hash” implementation, a custom lexer for WQL and a parser for a “mof” file format.

Still not clear on what it does. Seems safe.

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by dralley on Tuesday September 14, 2021 @11:36PM (#28534961)
> a standard, absolutely gigantic C/C++ project that re-invents absolutely everything including an event loop, http server, XML parser, a C++ tool to generate C code to create a “str hash” implementation, a custom lexer for WQL and a parser for a “mof” file format.

This is the part that gets missed when people talk about "dependency inflation" re: Rust. Absolutely, it is a problem, but most C codebases of a sufficient size and vintage are vendoring some absolutely insane hidden "dependencies" that, on average, probably get a lot less testing and attention than the average package on crates.io.

There are definitely risks with both approaches.

https://wiki.alopex.li/LetsBeRealAboutDependencies

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by capableweb on Wednesday September 15, 2021 @04:51AM (#28536773)
Not sure why what you're saying would be more true for C/Rust/JavaScript or any other language. The perverse idea of adding dependencies without actually reading through all the code you pull in exists in basically all language ecosystems, Rust included.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by jstanley on Wednesday September 15, 2021 @05:45AM (#28537131)
In C it is much more inconvenient to include external dependencies, so it's much more common for people to roll their own implementations rather than using a tried-and-tested one.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by xmaayy on Wednesday September 15, 2021 @09:50AM (#28539007)
Or copy in a .C/.h file that gets forgotten about, and therefore gets no security updates.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by gsam on Wednesday September 15, 2021 @01:03AM (#28535442)
CIM/WBEM goes all the way back to 1996. They essentially wanted a management infrastructure on all kinds of devices (including different architectures, so actually C made sense then), but that also notably included remote access. At the time, SOAP was still popular, so here we are with a rather silly transport protocol and all kinds of overhead reinventing things like SSH. However, the overall goal still makes sense, it was essentially a way of 'object'-ifying everything from logs to other metrics. This fit in with the overall mode of thinking in MS with DCOM and COM (and registry), and structured configuration/management. I'm sure it's paid massive dividends on Azure Linux infrastructure. For highly structured objects, SOAP and XML aren't a terrible fit, but I doubt many people would do the same thing again today.

Honestly, they just needed to rewrite it in a safer stack. However, that still may not have saved them from all these vulnerabilities, given the scope of what they're implementing as remote management protocols. The relative scrutiny, fuzzing and manpower just hasn't been there, especially when it's obfuscated by various layers.

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by onionisafruit on Wednesday September 15, 2021 @02:16AM (#28535820)
Not to take away from the rest of what you said, but I don’t think SOAP was _still_ popular in 1996. I don’t think it had become popular yet. I don’t think I even heard of SOAP before 1999 or 2000. I’m not a trend setter or anything, but if it was popular, I probably would have at least heard of it.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by homarp on Wednesday September 15, 2021 @02:44AM (#28536000)
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by gsam on Wednesday September 15, 2021 @09:30PM (#28546844)
That's fair, I was more speaking about XML and its use as a form of binary transport. Things like WS-Management and explicit SOAP obviously came a little bit later, and SOAP-like technologies were popularized for more general use in the 2000s. I think it's fair to say my experiences in general lean more towards observing standards groups.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by jerf on Wednesday September 15, 2021 @12:12AM (#28535200)
Greenspun's law, "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp." is really just a special case of a general principle. There's a lot of cases where if you use the wrong tool and/or don't know the right libraries, or don't or can't use them, or just won't, that you'll reinvent something that already exists, badly.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by Cyph0n on Tuesday September 14, 2021 @11:16PM (#28534839)
Looks like it’s mostly C, and not great C at that… In my humble opinion, this is a scary looking project.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by randomfool on Wednesday September 15, 2021 @01:14AM (#28535501)
Specifically- it appears to be mostly C99, lots of macros, lots of ugly buffer manipulation. But it's tooled for PREFast so you know it's secure! (https://github.com/microsoft/omi/blob/4ce2cf1cb0aa656b8eb934...) (j/k... I haven't seen that in ages). Guessing a port of MS's internal WMI codebase?

This codebase just smells of rot all over.

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by pjmlp on Wednesday September 15, 2021 @05:01AM (#28536846)
That is why there is "Modern C", "Modern C++" as talked at conferences, blog posts and endless over here, and then real life code that we actually find out in production.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by int_19h on Wednesday September 15, 2021 @06:40AM (#28537472)
I've seen and written plenty of modern (at the time of writing) C++ in production. It really depends on the team and the product.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by pjmlp on Wednesday September 15, 2021 @06:53AM (#28537530)
Sure, yet this is the outcome from companies deeply involved in ISO, let alone those where regular folks don't even care HN exists.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by int_19h on Wednesday September 15, 2021 @01:59PM (#28542276)
Ironically, most modern C++ code I wrote was not for Microsoft, but a much smaller company that is not in any way involved in ISO C++ standardization process. It was due to that company culture - senior engineering leadership (which were also the founders) were all big standard C++ fans, and they wrote much of the original codebase.

Large companies like MS often have codebases that are so ancient (e.g. HRESULTs and IF_ERR_GOTO type macros everywhere), they only get modernized very gradually if at all.

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by pjmlp on Wednesday September 15, 2021 @04:56PM (#28544241)
I only use C++ for libraries that are then plugged into managed runtimes.

Most of the stuff I see in the wild could be considered what I call C+, basically MFC style with plenty of C love.

While Microsoft has the excuse for older code bases, stuff like WRL and C++/WinRT also has its share of not only following what is preached regarding C++ Core Guidelines love.

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by silon42 on Wednesday September 15, 2021 @06:40AM (#28537470)
So the choice is RIIR or RIIC++ ?
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by pjmlp on Wednesday September 15, 2021 @06:52AM (#28537524)
It can also be RIIC#, RIID, RIIGo, RIIAda, RIIJava,... take your pick.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by pjmlp on Wednesday September 15, 2021 @04:58AM (#28536819)
In typical Microsoft fashion, regardless of how much victories .NET and now Rust dev units achieve, the OS ones keep pushing for C and C++ no matter what.

That is also why we now have WinRT, WinUI, Sphere OS, Azure RTOS, regardless of what Microsoft Security advises.

Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by the-dude on Wednesday September 15, 2021 @08:06AM (#28538002)
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by jeffbee on Tuesday September 14, 2021 @11:03PM (#28534756)
The "fix" doesn't include any tests that would indicate that it actually works. Doesn't seem like a very healthy project.
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by rajamaka on Tuesday September 14, 2021 @11:59PM (#28535110)
The explanatory commit message of "Enhanced security" should be enough to document all you need to know!
Re:"Secret" Agent Exposes Azure Customers to Unauthorized Co... by cube00 on Wednesday September 15, 2021 @01:33AM (#28535595)
You'd think a mention of the CVEs involved is mandatory for commits like these.