06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Hacker Culture · DEF CON · · 19:47 runtime

DCSG1 - Augmenting Apple's Source Code and OS Logs with AI Agents -Olivia Gallucci

Transcript 3530 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

here. Cool. Okay. Um, all right. Hi everyone. Thank you so much for having me. My name is Olivia Gluchi and I work at Data Dog. Today I want to show an AI workflow for Mac OS vulnerability research. So before I begin, I want to mention a tool I published called OSS Sensor. OSS sensor generates a prioritized evidencebacked research queue derived from Apple OSS Diffs basic binary features and log templates. It applies custom rule-based scoring and reporting to support triage. The binary and log analysis components are intentionally lightweight and there's no integrated LLM or vulnerability verification. It's designed as a triage and hypothesis generation aid, not as a automated vulnerability discovery or exploitation tool. There are currently two versions of this project available, one without built-in AI integration and one with AI capabilities. The nonAI version is more streamlined and significantly easier to adapt if you plan to integrate your own AI workflow.

I strongly recommend this approach particularly if you intend to iterate quickly or vibe code your enhancements. Another use case for this is if you already have an established workflow that you prefer. This way it will be p uh like personalized to your setup and it won't be dependent on how I set it up. That said, the PR for plug-and-play with AI API keys is still under review and testing. And this is because parts of my workflow, which this talk tools inspired by, includes intentional, lightweight, manual intervention steps. While I was developing this process, I quickly learned that certain configurations can become costly depending on usage. Thus, I'm unsure who might really want a plug-and-play version, especially if you're a beginner in vulnerability research on Apple's operating systems. If you'd like to explore this tool, there's several built-in demos available. When connected to an AI coding agent, the tool will outline the required execution steps and demonstrate scoring and weighing out of the box. And from there, you can incorporate your own AI workflow. Given the tool's simplicity and modular design, this is achievable with a few prompts. And this talk will cover where AI has helped me in my research process and how I've influenced AI to better suits my needs. Given that around a year ago, many AI chatbots couldn't tell you how to access logs on Mac OS.

So in this talk, the AI vulnerability research components we will focus on are reverse engineering and fuzzing. Reverse engineering is inverting how a compiled system works from binaries and runtime behavior. While fuzzing is automatically generating and mutating inputs to exercise system and surface bugs via crashes or violated invariants. My workflow tries to automate steps in these areas that I have found to be most reliable. First, the AI workflow treats Apple's open- source code as a sensor. A sensor is any data source that produces signals about a system state or change without doing any interpretation for you. Second, the workflow then uses AI agents to turn that sensor into a prioritized cue. So, what changed, what looks security relevant, what to reverse, and what to fuzz. For context, an agent is a system that can take goals, select tools, run steps, and produce structured outputs. The problem is that Apple ships a huge uh security surface area, but only some of it is open source. Like Apple has over 400 public repos, but these releases are incomplete, outdated, and often very hard to keep up with manually. Thus, my time is limited by bandwidth. So, the story I'm going to tell is dip to hypothesis to harness. And the trick is that we augment open source diffs with two other signals, binaries and logs.

Now I want to address the elephant in the room which is Apple's secrecy. Apple actually open sources a lot more than most people expect. So the XMU kernel, core libraries like lib system, libc, lib dispatch, and historically some dammons like launchd. But they don't publish everything. Some components are missing or only partially available including things like core foundation, CF network, iOS specific drivers, pieces of dialode, and core crypto which also comes with additional redistribution constraints. Also, source completes can be incomp uh source drops can be incomplete or outdated and you'll see headers referencing files that don't exist or build instructions missing. for context on these constraints and why this workflow matters operationally um self shadow but I recommend uh watching my besides 312 talk which covers the history and manual version of the process I'm about to discuss. So what does this have to do with AI? Well, this information overload with Apple's 400 plus open source repos is exactly why AI agents help in this context. If I rely on a human, aka myself, doing manual repo exploration and one-off diffs, I end up with a very narrow view of risk.

If I automate that bookkeeping, I can spend more time on the parts that AI is not working well for me yet, which is reasoning about privilege boundaries and exploitability. I've even found this helpful for threat detection engineering. This matters because the faster I can understand what changed, the faster I can build detections and prioritize around new attack mechanics. So even though the code is incomplete, it still guides my research. The key is for both me and AI to treat it like a map. You might not have the full picture, but the landmarks are real. And what I do and what many researchers do is use Apple's open source as a reference while working with the proprietary binaries. You take a binary like launchd, sislog d or a driver and whatever source exists to match known function patterns, annotate uh you know call patterns and then reverse unknown logic. The agent angle is simple. Um,

you know, it's hybrid with manual and AI and it's effective, but it doesn't really scale. Agents can do the repetitive steps. So, correlate symbols, chase string anchors, retrieve relevant source context, and produce structured summaries that make a human reviewer faster and more consistent. And even when symbols are stripped, structure plus uh string constants plus sys call usage lets you map back to open source code. and four common tools, very basic tools show up consistently. So, strings gives you debug messages, format strings, and file paths. What can extract version and project info? And then there's NM, which lists symbol names if they exist, especially in unstrip binaries or frameworks. And class dump is great for interface uh information, especially private frameworks and Objective C uh method services. And when I'm trying to map binaries to source projects, I also use Apple's distribution manifests to cross-reference components per release.

I look at the release metadata when it exists, and I look for version strings or source file names via strings or what. All of these repetitive but context dependent steps are the exact operations I hand to an agent as tools. I don't want the model inventing facts. I want it calling strings, parsing the output, retrieving the corresponding source chunks, and then producing a bounded conclusion with citations to what it observed. After this, I usually want to go deeper with binary dipping dipping uh which is comparing binaries before and after a patch to identify changes. And so here's my favorite example of this. So in 2016, OSX

Reverser used a uh add-on called uh diaphra to diff syslog from version 101.2 2 to 101.3. He found only one

function had changed and that change was an allocation math fix. Value + 4 became value x 4 + 4. And from an exploitation mindset that's suspicious because it looks like a heap overflow mitigation. And there was a string nearby that stated add lockdown session reallock failed. And that was a hint back to the source. This type of surgical diffing is how vulnerabilities get reversed after a patch. And it matters because fixes

often need to be applied in multiple locations. If identical code is patched in some files but not in others, the unpatched ones can remain vulnerable. And the larger and more bureaucratic an organization is, you better bet there's going to be repeat mistakes in the neighboring files of their products. Now imagine that exact AI workflow running continuously on every Apple release. It would ingest new oss tags and tarballs and distribution manifests and compute diffs at the function and semantic level. It would then score changes for security relevance based on patterns like allocation math, bound checks, entitlement gating, XPC parsing, and IOKIT external method table changes. It would correlate to binaries and string anchors and then emit a ranked cue on why this looks risky, plus pointers for a human to validate. And for my solo offensive research, that was a three-point multiplier. I've only tested this on small individual components, never the full OS, but that would be awesome if I could do something like that for an organization. This would compress that loop from like Apple has just shipped something to we've identified these uh shifted behaviors and surfaces so that we can adjust our focus monitoring and triage faster. I'd imagine if this was scaled, this would be the kind of workflow you'd expect from a dedicated vulnerability research team that tracks platform changes as a routine operation rather than just like a random lady with her computer. And that's why I think this is worth discussing openly. It helps keep vulnerability discovery accessible to the junior engineer, which is me. So here's the architecture I've had the best results with. First, I use an agent pipeline approach. This means that I am utilizing a coordinated set of tool using agents that turns raw inputs. So diffs, binaries, and logs into evidencebacked outputs like arranged triage queue, hypothesis, and buzz/temmetry plans. I start by using a retriever. This is the indexing layer that searches embedded information like OSS code, symbols, notes, and log templates and returns the most relevant context for a given question or artifact. I then use a toolbox which is a curated set of deterministic analyzers and system commands like string o tool class dump and log queries. The agents then call to gather facts and generate evidence instead of just guessing. Then um more agents handle that output. I use different agents for diff triage re context hypothesizing planning and analysis. And I'm unable to tell you which ones are most effective but I can explain how I account for that later. I don't really treat the model as a a god.

I treat it as a junior engineer since I'm also a junior engineer that can read fast uh that you know can follow procedures and then generate structured hypotheses that we can validate with reversing tracing and fuzzing. Additionally, it's important to remember that each step in itself can break and they're all depending on each other. Thus, your setup should ideally account for that since you might be on a paid personal plan with limited resources and then blow through three grand in a month and then be big frown. So the big addition to this talk versus the classic like I used Apple OSS to reverse stuff is logs.

Unified sorry one second.

Unified logging gives you subsystem and category labels that map to components stable message strings that you can hunt in binaries and source and then execution hints that you can use to reconstruct uh data flow diagrams without that full source. I treat unified logs as a pivot into attack surface and code paths, not as doctrine because of bulk like log bulk that I don't always know how to handle. They're good at telling you which components actually handled that input often via subsystem or category plus sender image info and then what error paths fired that can reveal parsing assumptions, type expectations, and IPC contracts. And that's pretty good ROI ROI for target selection, harness design, and then the general question of what to fuzz next. In general, an AI agent can

do three useful bounded tasks with logs. So, first, it can take a log line and then find where that string lives in a binary via strings and then locate its basic block and caller. Next, it can retrieve adjacent OSS code for those callers if it exists and then produce a structured summary like inputs, trust boundaries, and parsing. Lastly, it can feed into fuzz planning or into detection engineering like what to fuzz, uh what parameters are attacker controlled, and then what failure modes would look like. And this is relevant to developing PC's as well as localized detection tests or endpoints um like on the endpoints because you'll be able to see like when your AI research uh pipeline learns a new untrusted input boundary or a new privilege XPC entry point, you can then translate that into telemetry requirements and correlation rules. And in general, that's how you turn vulnerability research into coverage. It's just in the past, we did it manually without AI. The same idea kind of applies to those like back in the day uh kernel extensions. By dipping KX across versions, researchers have found changes to external method tables that surface new and/or patched entry points and IO kit drivers. Now getting

back to the uh agent pipeline stuff. What the AI fuzz planner agent produces is not an exploit unless you made it do it that somehow. It's a general plan. First it enumerates candidate surfaces like sis call handlers, IOKit user clients, XBC services and then parsers so that you can focus on the entry points that are attacker controlled and

ideally cross a trust boundary. Then it proposes a minimal test uh driver or harness scaffold including the invocation path, entitlement requirements and expected input shape so that the target is reachable and reproducible at scale. Here that means uh more of repeatability than general scale. Next, the AI recommends a seed strategy by extracting dictionaries from strings, mining parameters from logs or bootstropping from observed traffic so that coverage ramps up quickly instead of mutating from nothing. Note that if the command is not available in the subset that I provided, you can add them yourself or connect an AI search chatbot that can find them automatically. As someone who has like multiple laptops and has the ability to like have dedicated test laptops with multiple processors, um I don't really recommend allowing AI to search the internet and then run things on your machine if you don't have a machine that's solely for test purposing. Um, also a seed strategy is the method for selecting and generating the initial set of representative inputs that bootstraps a buzzer's coverage and guides mutations towards highv value code paths. So finally the AI defined success metrics.

So crash bucketing, sanitizer signals and unique stack traces so you can identify progress and ideally turn those uh results into actionable research.

So, where this AI workflow breaks down today is when you ask for full exploit chains. To be honest with you, I'm not in the point in my research career where I'm able to do like full privilege escalations and like disabling all the Mac OS security controls and all of that. Uh, additionally, I've spent significant time just trying to understand and test how the operating system is working and this knowledge has been great for that learning by doing approach. That said, the models will occasionally invent steps, especially if you hook up an AI chatbot. So I keep it constrained. I use bug class prediction and harness design. These are the high value outputs. And then humans own the exploitability. This also keeps the larger AI models happy given that a lot of them try to put in mechanisms to lock them down even for like legitimate offensive research purposes. And if you're like me and don't fully trust your first past instincts, it helps to sanity check ideas against high quality public work. For example, Patrick Wle has an extensive body of writing and I use AI tooling to check whether or not my hypotheses line up with established techniques in his published analysis as well as other articles in my own notes.

This isn't wired into the OSS project yet, but I might add it since I do these sanity checks quite frequently. Also, credit where credit's due. I intentionally license OSS sensor GPLV3 because I learned a lot from other GPLv3 license work by Patrick and many others. So keeping this code sharable helps others build and learn in the same way. So the TLDDR is that uh even partial source is powerful and if you combine it with binary analysis, you can reverse Apple's systems with surprising accuracy. But there's also constraints which is incomplete oss releases, obuscation and licensing. You need a pipeline that is compliant by design with local indexing, careful handling of source drops and providence tracking so that you can explain every conclusion.

All of that said, what should we learn? So, the core idea I wanted to leave you with is that Apple's partial open source code can be treated like a sensor stream. It's not the full system, but it's a steady source of change signals, and those signals become much more valuable when you can process them continuously. The workflow I showed takes that sensor and turns it into our prioritized resource Q using AI agents, but with a very specific philosophy. The model isn't God. It's a tool using junior analysts, which keeps things cost-effective. The work happens in deterministic tooling and the model's job is to stitch together evidence, retrieve the right context and produce structured outputs that make a human faster and more consistent. And that's why the narrative is diff to hypothesis to harness. You start with a diff um binary or whatever some sort of source and then you just ask what meaningfully changed and where that trust boundary might be. It's almost similar to like a a skill like a skill.md.

Um, when you turn that into a testable hypothesis about a bug class, you're able to now find a lot more information using AI, but also using your common sense. It can help with size calculation issues, parsing assumptions, policy gating, or an interface surface shift. And then you can build a minimal test driver so that the path is reachable and reproducible, which sets you up for fuzzing in for validation. The trick is that the open source diff alone is not enough. So, we augment it with two other signals. the binaries because they reflect the reality that ships and OS logs because unified logging is a good ROI pivot into which components are actually handling the input and which error paths fired. The fuzz planner piece is an example of how this stays practical and bounded. It doesn't generate an exploit, it generates a plan. It tells you which services matter, how to reach them with a minimal harness, how to seed inputs so that coverage ramps quickly and how to measure results so that you can identify changes. And importantly, it acknowledges the limits. Open- source releases are incomplete, binaries can be opaque, and models can hallucinate.

That's why everything is evidencebacked, providence tracked, and compliant by design. So, I personally stopped throughout this process. I've utilized AI tools like chat GBT's deep research. But given the cost constraints, manual review is required for me, especially if it looks like something I won't understand. Given these systems are also great and uh, you know, are great, but also hallucinate. And given that I might not always know what I'm talking about, it's imperative for my research to have these checks. I found that by switching to Gemini, that was a huge cost saver for me because it was more accurate on the uh like lesser models. So like I don't have to use pro all the time. And then finally, this isn't just like an offensive research productivity hack.

The same pipeline shortens the loop for uh localized detection engineering. when you can quickly identify changes which behaviors and interfaces surfaces shift you can tr you can um change prioritization monitoring and triage faster and turn that platform churn into detection coverage so these are the outcomes I care about which is making Mac OS vulnerability research more scalable more teachable and more operationally useful so yeah I've uh more in terms of where you can go from here I released an Apple security focused newsletter called RT to read after I graduated university where I post approximately once a month or once every other month um on my research. And so yeah, thank you so much for providing me the opportunity to present. Um I hope you all enjoyed and if you have any questions, you can meet me outside afterwards because I don't want to hold up the next speaker. So yeah, um thank you so much. Bye-bye.

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers
That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 538 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks