Skip to content

Fix potential integer math crash on PublishPort.#1612

Merged
jglogan merged 1 commit into
apple:mainfrom
jglogan:publishport-crash
May 28, 2026
Merged

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

Conversation

@jglogan

@jglogan jglogan commented May 28, 2026

Copy link
Copy Markdown
Contributor

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%

@jglogan jglogan merged commit 445c90f into apple:main May 28, 2026
4 checks passed
@jglogan jglogan deleted the publishport-crash branch May 28, 2026 18:12
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

2 participants