Cyber Security News

Apple Xcode Integer Underflow Flaw Lets Crafted Archives Leak Memory and Crash Builds

A recently disclosed integer-underflow vulnerability in Apple’s modern Mach-O archive parser could allow a malicious static library to crash Xcode build processes or expose process memory through build logs.

This flaw affects the parser used by Apple’s newer linker, ld-prime, as well as related developer tools, including libtool, ranlib, and potentially dyld_info.

Apple Xcode Integer Underflow Flaw

Security researchers at SecureLayer7 reported that the issue lies in the `mach_o::Archive::Entry::name()` function, which parses the 16-byte filename field in Unix static archives (.a files).

Since static archives are often downloaded as prebuilt dependencies through package managers, vendor SDKs, and CI pipelines, this vulnerability presents a significant risk to the software supply chain.

The vulnerable code attempts to trim trailing spaces from an archive member name using an unsigned size_t index. When an attacker supplies an `ar_name` field filled with space characters, the loop decrements past index zero.

Instead of terminating safely, the unsigned value wraps to `SIZE_MAX`, causing the parser to walk backward outside the intended archive-name buffer. The function then returns a `std::string_view` with a valid-looking pointer but with an attacker-influenced, near-maximum length.

This corrupted length subsequently reaches normal toolchain error-handling and string-processing paths, leading to one of the following three outcomes:

  • A deterministic `SIGSEGV` when the linker’s formatting code calls `strlen()` and reads past the mapped archive file.
  • An out-of-bounds read that may print bytes from adjacent memory mappings to standard error.
  • A `SIGABRT` in libtool or ranlib after an attempt to allocate an impossibly large `std::string`, resulting in an uncaught `std::bad_alloc`.

The researchers demonstrated the issue with small crafted .a files, emphasizing that the archive is data rather than executable code. In other words, the payload needs only to be accepted as input for linking or archive processing; it does not need to be compiled or run as a program.

Apple’s mach_o library is part of the open-source dyld project and is used by the modern toolchain included with Xcode and Command Line Tools.

SecureLayer7 states that ld-prime has been the default linker for arm64, arm64e, and x86_64 builds since Xcode 15. Meanwhile, libtool and ranlib invoke developer-tool versions that use the same parser.

The legacy ld-classic linker reportedly utilizes separate, older archive-parsing code and is not affected by this vulnerability.

This distinction may give teams a temporary compatibility option where using the legacy linker is technically feasible; however, organizations should validate the build and security implications before changing linker settings.

The primary concern lies within automated build environments. A compromised archive embedded in a third-party SDK, binary dependency, vendored framework, or transitive package could be processed by a developer workstation or CI runner.

A crash could hinder releases, while sensitive memory information printed to CI logs could pose a significant confidentiality risk.

Disclosure and Mitigation

SecureLayer7 reported the issue to Apple Product Security on May 23, 2026, and noted that more than 90 days passed without a public patch. The report indicates that Apple characterized the finding as having “Limited Local Impact.”

This is the researcher’s account; Apple has not published a corresponding security advisory for Xcode in the reviewed materials.

Until Apple releases a fix, development and DevSecOps teams should treat untrusted static archives as high-risk build inputs by following these recommendations:

  • Pin and verify checksums for prebuilt .a dependencies.
  • Prefer reproducible builds from reviewed source where possible.
  • Restrict dependency ingestion in CI, especially from pull requests and external forks.
  • Run builds in isolated, short-lived workers with minimal credentials and restricted log access.
  • Monitor build failures involving ld, libtool, ranlib, EXC_BAD_ACCESS, or abnormal memory-allocation errors.

Apple’s public dyld repository contains the modern C++ codebase that maintains the affected archive parser.

Keep your SOC up to date on active malware & phishing within 24h of their emergence. Try ANYRUN to prevent incidents with early detection. 

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

1 day ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

1 day ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

1 day ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

1 day ago