Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document macOS sandbox security implications and __darwinAllowLocalNetworking #11488

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amarshall
Copy link
Member

Motivation

These things are undocumented, that seems bad.

Context

Some discussion in #11269 and #11270

I couldn’t find any better place to put this. I didn’t put it in the manual as there are currently no references (other than release notes) to the sandbox (but perhaps there should be!).

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Split the larger paragraph above so OS-specific bits are in separate
paragraphs. No changes to the split out text (just reformatting lines).
Comment on lines +628 to +629
The macOS sandbox has known limitations, and should not be
considered a strong security boundary.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I think this applies to the Linux one too. (The recent sandbox escape vulnerability worked on Linux but not macOS, even.)

Copy link
Member Author

@amarshall amarshall Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the difference is in what we strive for. We know the macOS sandbox is deficient today, and has known sandbox escape vectors. But fixing them is either extremely difficult or impossible due to OS API limitations. Compared to Linux where we give it a CVE and (I think) generally expect to be able to fix it and do so with some urgency.

Nevertheless, I do think it is important to clarify the project’s stance on whether the Linux sandbox should be and is generally believed to be (barring unknown bugs) a security boundary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it depends on what you consider an escape. Information exfiltration or communication with a cooperating process outside the sandbox, yeah, but I don’t think there’s a known way to escalate out of the macOS sandbox to increase privileges?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that’s true.

However, part of my concern with the macOS sandbox in particular is that there are, afaik, zero tests for it (whereas the Linux sandbox has at least some). The macOS sandbox APIs provided by the OS are also notoriously under-documented, so what we think is okay today might not be with a future update or OS version—and there’s no tests to assure that. That outbound network requests were inadvertently allowed for so long is a big canary. So I think that, compared to the Linux sandbox, we shouldn’t “guarantee” so much.

Copy link
Member

@bryanhonof bryanhonof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amarshall
Copy link
Member Author

@bryanhonof We could, but if we do so, should we not also for the Linux sandbox rules in some way? I’m curious as well what the goal of linking to it would be. Logistically, I’m also not sure how to link to them, we would need to link to the actual rules used, I think, so it cannot be a URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants