Skip to content

Fix potential integer math crash on PublishPort.#1612

Open
jglogan wants to merge 1 commit into
apple:mainfrom
jglogan:publishport-crash
Open

Fix potential integer math crash on PublishPort.#1612
jglogan wants to merge 1 commit into
apple:mainfrom
jglogan:publishport-crash

Conversation

@jglogan
Copy link
Copy Markdown
Contributor

@jglogan jglogan commented May 28, 2026

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

The problem only impacts the container application and not the system or other apps, and it requires sending raw publish ports through the container API server XPC interface as the standard client does validate inputs in the client utilities. Regardless, without proper validation it's possible to unintentionally or intentionally crash the apiserver with an XPC call.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

- Closes apple#1610.
- Discovered, and originally filed as a security advisory, by
  PresidentL <131139636+liyander@users.noreply.github.com>.
- `PublishPort` currently can store invalid
  combinations of starting port and range that
  can overflow UInt16 values when summed,
  crashing the process.
- Updates `PublishPort` to validate inputs
  on initialization.
@jglogan jglogan requested a review from realrajaryan May 28, 2026 02:30
@github-actions
Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 33.92%
Integration 19.5%
Combined 52.84%

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.

[Bug]: Unvalidated PublishPort ranges can crash container service processes through integer overflow

1 participant