Skip to content

Require forced macOS preferences for managed configuration - #46032

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/2eff08ba6b073b4c59ca757e054d112d2a5256d0
Sep 16, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/2eff08ba6b073b4c59ca757e054d112d2a5256d0

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Require forced macOS preferences for managed configuration

Why

CFPreferencesCopyAppValue also searches user-writable domains. Ordinary user defaults must not supply trusted administrator configuration or override lower requirements layers.

What changed

  • Check CFPreferencesAppValueIsForced before reading config_toml_base64 and requirements_toml_base64, and recheck after reading to ignore values that became unforced.
  • Wrap returned property-list values as CFType and require a CFString, returning InvalidData for other types without exposing preference contents.

Testing

Add tests for both preference keys covering unforced and missing values, loss of forced status during a read, preservation of string contents, and rejection of non-string values with diagnostics that omit their contents.

## Why

`CFPreferencesCopyAppValue` also searches user-writable domains. Ordinary user defaults must not supply trusted administrator configuration or override lower requirements layers.

## What changed

- Check `CFPreferencesAppValueIsForced` before reading `config_toml_base64` and `requirements_toml_base64`, and recheck after reading to ignore values that became unforced.
- Wrap returned property-list values as `CFType` and require a `CFString`, returning `InvalidData` for other types without exposing preference contents.

## Testing

Add tests for both preference keys covering unforced and missing values, loss of forced status during a read, preservation of string contents, and rejection of non-string values with diagnostics that omit their contents.

GitOrigin-RevId: 2eff08ba6b073b4c59ca757e054d112d2a5256d0
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/2eff08ba6b073b4c59ca757e054d112d2a5256d0 branch from 141e475 to 73bf181 Compare September 16, 2026 21:30
@copyberry
copyberry Bot merged commit 73bf181 into main Sep 16, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/2eff08ba6b073b4c59ca757e054d112d2a5256d0 branch September 16, 2026 21:30
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant