{"id":{"repo_id":"waterloo","oai_identifier":"oai:uwspace.uwaterloo.ca:10012/23294"},"canonical_url":"https://search.ndltd.org/etd/waterloo/oai:uwspace.uwaterloo.ca:10012/23294","repository":{"repo_id":"waterloo","name":"University of Waterloo","base_url":"https://dspacemainprd01.lib.uwaterloo.ca/server/oai/request"},"display":{"title":"Mitigating Risks to Dependability from Vibe-Coding C for Embedded Systems","abstract":"Vibe coding is the process of using a Large Language Model (LLM) to iteratively generate software code. It is popular, with 36% of workers at technology companies reporting adoption of generative artificial intelligence for software engineering in 2024 [1]. At this rate of use, LLM-generated code is quickly becoming part of the embedded-systems that comprise our everyday cyber-physical infrastructure. Most of this infrastructure is built on C language code [2]. LLM-generated C code poses threats to dependability, exhibiting faults such as buffer overflows, out-of-bounds writes, integer overflows, and more. In this work, we contribute methods for improving the dependability of these systems in three key parts: providing a real-world benchmark dataset for evaluating LLM-generated C code, protecting LLM code generation from poisoning attacks, and detecting changes in production embedded systems through power side-channel analysis. This work begins with an examination and categorization of weaknesses in LLMgenerated C code for embedded systems networking. Our findings suggest that LLMs perform poorly at programming tasks involving direct interactions with memory. Scores on existing LLM-generated C benchmarks do not adequately express this difficulty, as these benchmarks do not include sufficiently real-world C programming challenges. To support future testing of LLMs, we introduce EmbedEvalC, a dataset of C coding challenges to provide a benchmark against which LLMs can be evaluated on real-world tasks. Retrieval Augmented Code Generation (RACG) is an essential tool for vibe coding, but presents new threats to dependability from poisoning attacks. If an attacker can cause a RACG system to retrieve their crafted documents, they can induce the LLM to generate code with weaknesses. To detect this attack, we introduce canary functions, a process by which specific functions in the codebase are regenerated and re-tested to determine whether the addition of new documents induces new weaknesses. Finally, we consider the black-box setting where a systems integrator seeks to detect unexpected changes in embedded firmware. Such changes will only become more common with the proliferation of vibe coding. We suggest using power side-channel analysis to provide a feedback mechanism to a fuzzer in order to determine if a fuzzing input has caused a new response from the system. We show that responses involving five or more memory-interacting instructions are consistently detectable. In this work, we suggest a collection of techniques to mitigate risks to the dependability of embedded systems posed by LLM-generated C code. Abstract Citations: [1] Alex Singla, Alexander Sukharevsky, Lareina Yee, Michael Chui, and Bryce Hall. \"The state of AI: How organizations are rewiring to capture value\", McKinsey & Company, March 2025. [2] P. Soulier, D. Li, and J. R. Williams, “A Survey of Language-Based Approaches to Cyber-Physical and Embedded System Development,” Tsinghua Science and Technology, vol. 20, no. 2, pp. 130–141, 2015.","abstract_html":"Vibe coding is the process of using a Large Language Model (LLM) to iteratively generate software code. It is popular, with 36% of workers at technology companies reporting adoption of generative artificial intelligence for software engineering in 2024 [1]. At this rate of use, LLM-generated code is quickly becoming part of the embedded-systems that comprise our everyday cyber-physical infrastructure. Most of this infrastructure is built on C language code [2]. LLM-generated C code poses threats to dependability, exhibiting faults such as buffer overflows, out-of-bounds writes, integer overflows, and more. In this work, we contribute methods for improving the dependability of these systems in three key parts: providing a real-world benchmark dataset for evaluating LLM-generated C code, protecting LLM code generation from poisoning attacks, and detecting changes in production embedded systems through power side-channel analysis. This work begins with an examination and categorization of weaknesses in LLMgenerated C code for embedded systems networking. Our findings suggest that LLMs perform poorly at programming tasks involving direct interactions with memory. Scores on existing LLM-generated C benchmarks do not adequately express this difficulty, as these benchmarks do not include sufficiently real-world C programming challenges. To support future testing of LLMs, we introduce EmbedEvalC, a dataset of C coding challenges to provide a benchmark against which LLMs can be evaluated on real-world tasks. Retrieval Augmented Code Generation (RACG) is an essential tool for vibe coding, but presents new threats to dependability from poisoning attacks. If an attacker can cause a RACG system to retrieve their crafted documents, they can induce the LLM to generate code with weaknesses. To detect this attack, we introduce canary functions, a process by which specific functions in the codebase are regenerated and re-tested to determine whether the addition of new documents induces new weaknesses. Finally, we consider the black-box setting where a systems integrator seeks to detect unexpected changes in embedded firmware. Such changes will only become more common with the proliferation of vibe coding. We suggest using power side-channel analysis to provide a feedback mechanism to a fuzzer in order to determine if a fuzzing input has caused a new response from the system. We show that responses involving five or more memory-interacting instructions are consistently detectable. In this work, we suggest a collection of techniques to mitigate risks to the dependability of embedded systems posed by LLM-generated C code. Abstract Citations: [1] Alex Singla, Alexander Sukharevsky, Lareina Yee, Michael Chui, and Bryce Hall. &quot;The state of AI: How organizations are rewiring to capture value&quot;, McKinsey &amp; Company, March 2025. [2] P. Soulier, D. Li, and J. R. Williams, “A Survey of Language-Based Approaches to Cyber-Physical and Embedded System Development,” Tsinghua Science and Technology, vol. 20, no. 2, pp. 130–141, 2015.","abstract_has_math":false,"creators":["Dunne, Murray"],"institution":"University of Waterloo","degree_name":null,"degree_level":null,"degree_discipline":null,"degree_department":null,"school":null,"contributors":[],"advisors":[],"committee_chairs":[],"committee_members":[],"year":2026,"date_issued":"2026-05-13","date_published":"2026-05-13","updated_at":"2026-11-19T10:55:11Z","subjects":["large language models","code generation","security","embedded systems"],"languages":["en"],"rights":[],"rights_urls":[],"identifier_entries":[],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/10012/23294","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/10012/23294","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","download_url":null,"download_label":null,"download_source":null,"access_status":null,"embargo_until":null,"access_note":null},"source_record":{"url":"https://dspacemainprd01.lib.uwaterloo.ca/server/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Auwspace.uwaterloo.ca%3A10012%2F23294","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:creator","label":"Author","values":["Dunne, Murray"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2026-05-13T14:25:45Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2026-05-13T14:25:45Z"]},{"key":"dc:date.issued","label":"Date","values":["2026-05-13"]},{"key":"dc:date.submitted","label":"Dc Date Submitted","values":["2026-05-06"]},{"key":"dc:publisher","label":"Institution","values":["University of Waterloo"]},{"key":"dc:relation.uri","label":"Dc Relation URI","values":["https://github.com/murraydunne/EmbedEvalC"]},{"key":"dc:type","label":"Dc Type","values":["Doctoral Thesis"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["large language models","code generation","security","embedded systems"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["en"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://hdl.handle.net/10012/23294"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["Vibe coding is the process of using a Large Language Model (LLM) to iteratively generate software code. It is popular, with 36% of workers at technology companies reporting adoption of generative artificial intelligence for software engineering in 2024 [1]. At this rate of use, LLM-generated code is quickly becoming part of the embedded-systems that comprise our everyday cyber-physical infrastructure. Most of this infrastructure is built on C language code [2]. LLM-generated C code poses threats to dependability, exhibiting faults such as buffer overflows, out-of-bounds writes, integer overflows, and more. In this work, we contribute methods for improving the dependability of these systems in three key parts: providing a real-world benchmark dataset for evaluating LLM-generated C code, protecting LLM code generation from poisoning attacks, and detecting changes in production embedded systems through power side-channel analysis. This work begins with an examination and categorization of weaknesses in LLMgenerated C code for embedded systems networking. Our findings suggest that LLMs perform poorly at programming tasks involving direct interactions with memory. Scores on existing LLM-generated C benchmarks do not adequately express this difficulty, as these benchmarks do not include sufficiently real-world C programming challenges. To support future testing of LLMs, we introduce EmbedEvalC, a dataset of C coding challenges to provide a benchmark against which LLMs can be evaluated on real-world tasks. Retrieval Augmented Code Generation (RACG) is an essential tool for vibe coding, but presents new threats to dependability from poisoning attacks. If an attacker can cause a RACG system to retrieve their crafted documents, they can induce the LLM to generate code with weaknesses. To detect this attack, we introduce canary functions, a process by which specific functions in the codebase are regenerated and re-tested to determine whether the addition of new documents induces new weaknesses. Finally, we consider the black-box setting where a systems integrator seeks to detect unexpected changes in embedded firmware. Such changes will only become more common with the proliferation of vibe coding. We suggest using power side-channel analysis to provide a feedback mechanism to a fuzzer in order to determine if a fuzzing input has caused a new response from the system. We show that responses involving five or more memory-interacting instructions are consistently detectable. In this work, we suggest a collection of techniques to mitigate risks to the dependability of embedded systems posed by LLM-generated C code. Abstract Citations: [1] Alex Singla, Alexander Sukharevsky, Lareina Yee, Michael Chui, and Bryce Hall. \"The state of AI: How organizations are rewiring to capture value\", McKinsey & Company, March 2025. [2] P. Soulier, D. Li, and J. R. Williams, “A Survey of Language-Based Approaches to Cyber-Physical and Embedded System Development,” Tsinghua Science and Technology, vol. 20, no. 2, pp. 130–141, 2015."]},{"key":"dc:title","label":"Title","values":["Mitigating Risks to Dependability from Vibe-Coding C for Embedded Systems"]},{"key":"others:access_status","label":"Others Access Status","values":["open.access"]}]}],"canonical_facts":{"dc:creator":["Dunne, Murray"],"dc:date.accessioned":["2026-05-13T14:25:45Z"],"dc:date.available":["2026-05-13T14:25:45Z"],"dc:date.issued":["2026-05-13"],"dc:date.submitted":["2026-05-06"],"dc:description.abstract":["Vibe coding is the process of using a Large Language Model (LLM) to iteratively generate software code. It is popular, with 36% of workers at technology companies reporting adoption of generative artificial intelligence for software engineering in 2024 [1]. At this rate of use, LLM-generated code is quickly becoming part of the embedded-systems that comprise our everyday cyber-physical infrastructure. Most of this infrastructure is built on C language code [2]. LLM-generated C code poses threats to dependability, exhibiting faults such as buffer overflows, out-of-bounds writes, integer overflows, and more. In this work, we contribute methods for improving the dependability of these systems in three key parts: providing a real-world benchmark dataset for evaluating LLM-generated C code, protecting LLM code generation from poisoning attacks, and detecting changes in production embedded systems through power side-channel analysis. This work begins with an examination and categorization of weaknesses in LLMgenerated C code for embedded systems networking. Our findings suggest that LLMs perform poorly at programming tasks involving direct interactions with memory. Scores on existing LLM-generated C benchmarks do not adequately express this difficulty, as these benchmarks do not include sufficiently real-world C programming challenges. To support future testing of LLMs, we introduce EmbedEvalC, a dataset of C coding challenges to provide a benchmark against which LLMs can be evaluated on real-world tasks. Retrieval Augmented Code Generation (RACG) is an essential tool for vibe coding, but presents new threats to dependability from poisoning attacks. If an attacker can cause a RACG system to retrieve their crafted documents, they can induce the LLM to generate code with weaknesses. To detect this attack, we introduce canary functions, a process by which specific functions in the codebase are regenerated and re-tested to determine whether the addition of new documents induces new weaknesses. Finally, we consider the black-box setting where a systems integrator seeks to detect unexpected changes in embedded firmware. Such changes will only become more common with the proliferation of vibe coding. We suggest using power side-channel analysis to provide a feedback mechanism to a fuzzer in order to determine if a fuzzing input has caused a new response from the system. We show that responses involving five or more memory-interacting instructions are consistently detectable. In this work, we suggest a collection of techniques to mitigate risks to the dependability of embedded systems posed by LLM-generated C code. Abstract Citations: [1] Alex Singla, Alexander Sukharevsky, Lareina Yee, Michael Chui, and Bryce Hall. \"The state of AI: How organizations are rewiring to capture value\", McKinsey & Company, March 2025. [2] P. Soulier, D. Li, and J. R. Williams, “A Survey of Language-Based Approaches to Cyber-Physical and Embedded System Development,” Tsinghua Science and Technology, vol. 20, no. 2, pp. 130–141, 2015."],"dc:identifier.uri":["https://hdl.handle.net/10012/23294"],"dc:language.iso":["en"],"dc:publisher":["University of Waterloo"],"dc:relation.uri":["https://github.com/murraydunne/EmbedEvalC"],"dc:subject":["large language models","code generation","security","embedded systems"],"dc:title":["Mitigating Risks to Dependability from Vibe-Coding C for Embedded Systems"],"dc:type":["Doctoral Thesis"],"others:access_status":["open.access"]},"updated_at":"2026-11-19T10:55:11Z"}