BumpyClock/agent-templates / skills/programming
programming
UnverifiedImplement, debug, refactor, or review code with scoped changes and evidence.
references/apple/upstream/audit-xcode-security-settings/references/readonly-platform-memory.md
View on GitHub# Read-Only Platform Memory
Marks regions of memory used by the platform for internal state (such as the dynamic loader) as read-only, preventing tampering.
> **Apple developer documentation:** entitlement reference for [`com.apple.security.hardened-process.dyld-ro`](doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.security.hardened-process.dyld-ro).
## What It Does
Informs the system to mark memory regions in your process that the platform uses for its internal state as **read-only**. This primarily protects the dynamic loader (dyld) internal data structures from being modified by an attacker who has achieved code execution in your process.
## What Vulnerabilities It Mitigates
- **Dyld state tampering** — an attacker modifying the dynamic loader's internal data to redirect library loading
- **Runtime metadata corruption** — overwriting platform-internal data structures to alter program behavior
- **Post-exploitation persistence** — modifying loader state to maintain control after initial exploitation
## How to Enable
**Xcode UI:** Signing & Capabilities > Enhanced Security > check "Enable Read-Only Platform Memory"
**Entitlement:** `com.apple.security.hardened-process.dyld-ro`
Enabled by default when you add the Enhanced Security capability.
## Code Changes Required
**Usually none.** In most applications, this entitlement requires no code changes.
The only exception: if your app **modifies data in protected memory regions** (for example, modifying the value of `const` data sections), the system will crash your app. Fix: remove the code that writes to read-only memory.
## How to Disable
**Xcode UI:** Uncheck "Enable Read-Only Platform Memory" in the Enhanced Security capability
## Platform Availability
- iOS, iPadOS, macOS, visionOS
- Available on all supported hardware
## Performance and Stability Impact
- **Performance:** None. Memory is marked read-only at load time; no ongoing runtime checks.
- **Stability:** Unless your code writes to `const` data sections or platform-internal memory (which is already a bug), this has zero impact.
## Why This Feature Is Low-Risk
Read-only platform memory is one of the safest Enhanced Security features:
- No runtime cost
- No code changes for well-behaved code
- Only crashes code that was already doing something wrong (writing to `const` memory)
- Provides meaningful protection against post-exploitation techniques
Enable this early alongside compiler warnings and stack zero init.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |