Named Pipes in .NET 6 with Tray Icon and Service
erikengberg.com
erikengberg.com
Consider that if a user-mode application can send messages to a privileged process (like a Windows service).
What prevents any user-mode application from doing that? And if your Windows service is running as "NT_AUTHORITY/SYSTEM" and even executes privileged commands, well you might find you've got a simple privilege escalation vuln.
Remember, secure your named pipes...especially when the named pipe server runs as SYSTEM.
- https://stackoverflow.com/a/59983266
- https://versprite.com/blog/security-research/vulnerable-name...
Then the only thing the user-mode application can send are just flags (integers) that the service has already pre-determined what it will do in response.
Here's an article: https://www.codeproject.com/Articles/24434/How-to-Write-Wind...
And here's a succinct example: https://stackoverflow.com/a/5805700
The server needs to call ImpersonateNamedPipeClient() on the incoming client connection to assume the client’s security token, that would lower the server’s privilege to the level of the client. That’s it!
A guest level client can connect to the server. The server’s privilege becomes guest, and cannot access any resources that guest has no permission to access.
[1] https://docs.microsoft.com/en-us/windows/win32/api/namedpipe...
https://docs.microsoft.com/en-us/dotnet/api/system.servicepr...
You've definitely outlined the risk clearly of allowing a client to specify anything arbitrarily.
I once wrote a sudo implementation for Windows Vista / Windows 7 and first attempt used named pipes communicating to a windows service that did some token manipulation to execute things as the user (but with elevated token attached as well). There be (security) dragons.
I like using named pipes and they are a great IPC mechanism for communicating amongst processes of the same privilege level. I would not use them for message passing between processes of different privilege levels.
NamedPipes are sweet for doing same-machine IPC on Windows, that is for sure, but the built-in API is full of footguns.
See https://stackoverflow.com/questions/31936100/namedpipeserver...
Edit: would like to know why I'm being downvoted.
- Create a architecture diagram out of .NET and native compiled code.
- Integration with SharePoint and Dynamix SDKs
- SQL Server and Azure SDKs
- Using the Fakes mocking framework for MSIL rewriting
- Debugging the GPU shaders
Just a couple of examples, I can take plenty more out of VS enterprise.
I really don't get how people can think JetBrains does better than platform owners.
They will ever play catch-up with platform capabilities and only offer a subset of the package.
> They will ever play catch-up with platform capabilities and only offer a subset of the package.
Obviously, they are competing with a 20+yo product.
But atleast I can get all my .NET work done on Linux without needing slow bloated VS with a ton of useless features like 'unit testing for poor code choices or legacy codebases', or 'integration with the 2nd worst collaborative tool after Jira'.
Looking forward to see how they deal with MAUI and Blazor integration.
What others call bloat I call productivity features.
Having used both Visual Studio and Rider for many years now, one is definitely playing catch up but I’m not convinced it’s Rider.
There is an equally long list of things that Rider does and VS doesn’t. There’s a reason Resharper for Visual Studio is so popular.
I’m fond of Visual Studio but using Rider on macOS instead of VS on Windows is a much nicer experience for my .NET development (and I know it’s subjective).
Also worth bearing in mind Rider’s cost vs VS Enterprise’s eye-watering licence fees.
Borland taught me what it means to always being a 2nd class experience versus owning the platform tooling.
People complain about VS bloat and their answers is to put a yet another heavy weight plugin on top.
When my teammates ask me why my VS is so fast versus theirs, well I don't run Resharper.
I've seen a lot of documentation (third party and Microsoft) that just start in on a "Visual Studio"-based solution while ignoring everything else, which kind of rubs me the wrong way.
Yeah I know the feeling. I like to remind people there is a good development experience on linux also when using Rider. Sometimes feel like people are still stuck on “.net is windows only!”
Security can be achieved not at channel level but at message level: If cannot decrypt the message then it's not for you. At the expense of overhead you open the door for flexibility.
Ultimately it's a tool. What it matters is how you use it. Definitely better than using shared memory for IPC. Files are by default not secured either. Anyone can write into it.
Edit: Never mind, see https://docs.microsoft.com/en-us/dotnet/standard/serializati...
Are there any apps (except for creating stuff) that are being developed in a way that “server” part is running locally? It seems to me that everything goes web now and if you have a desktop it’s “just” a client for something remote?