**Language-based Security** [*Marco Vassena*](https://webspace.science.uu.nl/~4110161/) Building secure systems is notoriously hard. Despite every security patch, attackers always seem to find new exploits. A huge part of the problem is that developers do not have the right tools to write secure software. They build complex systems that handle sensitive data using programming languages that do not account for security or privacy. Thus, developers can too easily introduce bugs that attackers can exploit as security vulnerabilities to breach their systems. Language-based security applies rigorous programming language techniques to help developers address the security problems of their systems. This course studies techniques to develop programming languages and analyses that prevent security bugs. In the first part of the course, we will learn how attackers can exploit memory safety vulnerabilities to hijack programs and how compilers mitigate these attacks. Then, we will learn how WebAssembly prevents sandbox breakouts by design, allowing web browsers and edge platforms to safely run untrusted code. Lastly, we will study basic program analysis techniques and apply them to prevent information leaks in untrusted and cryptographic code. The course combines theoretical foundations and hands-on experience. We will design programming languages and analyses using formal semantics to specify and establish their security guarantees. The practical assignments will provide experience implementing static analyzers and WebAssembly interpreters. Learning Objectives =============================================================================== After successfully passing the course, you will be able to * Identify security vulnerabilities and assess their impact in simple settings * Design defense mechanisms and establish their security guarantees using formal semantics * Develop programming languages, compiler passes, and program analyses that prevent specific types of security bugs About =============================================================================== **Staff**: - [Marco Vassena](https://webspace.science.uu.nl/~4110161/) * Contact: MS Teams * Office hours by appointment, BBG 5.72 - Lawrence Chonavel - Alex Ionescu **Lectures and lab sessions** are in [DALTON 500 - 1.27](https://www.uu.nl/en/daltonlaan-500): - Wednesday, 13:15-17:00 - Friday, 9:00-12:45 Schedule =============================================================================== *This schedule is preliminary and subject to change.* Wed Apr 24 2024: Introduction * [intro.pdf](https://git.science.uu.nl/4110161/lbs-24/tree/main/lectures/lec0/intro.pdf) * [Join the MS Teams channel](https://teams.microsoft.com/l/team/19%3AiDRSCAKQoTP5fSNaEFc9SmEk_8KzKwYbovBx3mtHdmY1%40thread.tacv2/conversations?groupId=e7169735-a42b-43a6-9417-2d2bac93d92b&tenantId=d72758a0-a446-4e0f-a0aa-4bf95a4a10e7) * [Fill intro survey](https://docs.google.com/forms/d/e/1FAIpQLSeB60voosrAWMNE0tl-gePrBs0EWDz7sOeHlbZu9DwWEAMsqQ/viewform) * Start working on assignment 0 (Wed Apr 24 2024): **Assignment 0 out** Fri Apr 26 2024: Unsafe programming * [Slides and scripts](https://git.science.uu.nl/4110161/lbs-24/tree/main/lectures/lec1) * *Reading*: [SoK: Eternal War in Memory](https://people.eecs.berkeley.edu/~dawnsong/papers/Oakland13-SoK-CR.pdf) by Szekeres et al. (Fri Apr 26 2024): **Assignment 1 out** Wed May 1 2024: Buffer overflow defenses * [Slides](https://git.science.uu.nl/4110161/lbs-24/tree/main/lectures/lec2/bo-defenses.pdf) (Fri May 3 2024): **Assignment 1 due** Fri May 3 2024: Rust: Ownership * [Slides and scripts](https://git.science.uu.nl/4110161/lbs-24/tree/main/lectures/lec3) * *Reading*: [The Rust Programming Language](https://doc.rust-lang.org/book/#the-rust-programming-language) (Chapter 4) (Fri May 3 2024): **Assignment 2 out** Wed May 8 2024: Rust: Traits * [Slides](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/lectures/lec4/traits.pdf) * *Reading*: [The Rust Programming Language](https://doc.rust-lang.org/book/#the-rust-programming-language) (Chapter 10) (Fri May 10 2024): **Holiday** (Fri May 10 2024): **Assignment 2 due** Wed May 15 2024: WebAssembly 1 - [Slides](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/lectures/lec5/core-wasm.pdf) - [Notes](lectures/lec5/notes/1-core-wasm.md.html) - [Scripts](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/lectures/lec5/scripts/) - *Reading*: [Bringing the Web up to Speed with WebAssembly](https://dl.acm.org/doi/pdf/10.1145/3062341.3062363) by Haas et al. (Wed May 15 2024): **Assignment 3 out** Fri May 17 2024: WebAssembly 2 - [Slides](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/lectures/lec6/) - [Notes](notes/2-control-flow.md.html) (Wed May 22 2024): **Assignment 3 due ** Wed May 22 2024: Information-Flow Control - [Slides](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/lectures/lec7/) - *Reading*: [Language-Based Information-Flow Security](https://www.cs.cornell.edu/andru/papers/jsac/sm-jsac03.pdf) by A. Sabelfeld and A. C. Myers (Wed May 22 2024): **Assignment 4 out** Fri May 24 2024: IFC Libraries - [Slides](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/lectures/lec8/) - *Reading*: [Functional Pearl: Two Can Keep a Secret, If One of Them Uses Haskell](https://www.cse.chalmers.se/~russo/publications_files/pearl-russo.pdf) by A. Russo (Wed May 29 2024): **Assignments 4 due** Wed May 29 2024: Constant-time programming - [Slides](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/lectures/lec9/) - *Additional reading*: * [Why Constant-Time Crypto?](https://www.bearssl.org/constanttime.html) * [System-level non-interference for constant-time cryptography](https://davidpichardie.github.io/papers/ccs14.pdf) by Barthe et al. (Wed May 29 2024): **Assignments 5 out** Fri May 31 2024: Spectre attacks - [Slides](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/lectures/lec10/) Additional reading: - [Automatically eliminating speculative leaks from cryptographic code with blade](https://dl.acm.org/doi/10.1145/3434330) by Vassena et al. - [Hardware-Software Contracts for Secure Speculation](https://mguarnieri.github.io/publication/sp2021/sp2021.pdf) by Guarnieri et al. - [SoK: Practical Foundations for Software Spectre Defenses](https://cseweb.ucsd.edu/~dstefan/pubs/cauligi:2022:sok.pdf) by Cauligi et al. (Wed Jun 5 2024): **Assignment 5 due** Wed Jun 5 2024: Improve assignments Fri Jun 7 2024: Guest lecture @ 11:00 * **Title:** Software composition analysis * **Speaker:** Evgenii Kotelnikov, Sneak Wed Jun 12 2024: Guest lecture * **Title:** Specification and Verification of Side-channel Security for Open-source Processors via Leakage Contracts * **Speaker:** Klaus von Gleissenthall, VU Amsterdam * [Slides](https://gleissen.github.io/papers/utrecht-slides.pdf) Fri Jun 14 2024: Improve assignments Wed Jun 19 2024: Improve assignments Fri Jun 21 2024: Exam Preparation * Fill in the [survey](https://forms.gle/BDbX3ndrCkgyqVUK6) * Practice: [exam](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/exams/2023-exam.pdf?ref_type=heads), [solutions](https://git.science.uu.nl/4110161/lbs-24/-/blob/main/exams/2023-exam-solution.pdf?ref_type=heads). (Note: this year we dropped some topics and add some new ones). * [Slides](https://git.science.uu.nl/4110161/lbs-24/-/blob/894d800b98b24905f7064a445eff63301afc03b7/lectures/lec11/wrap-up.pdf) Fri Jun 28 2024: Exam - EDUC - GAMMA, 13:30 - 16:30 Fri Jul 12 2024: Retake Exam - EDUC - ALFA, 13:30 - 16:30 Evaluation =============================================================================== Your final grade is a weighted average of programming assignments and a written exam. Both the exam grade and the average of the assignments have to be 5.0 or higher to pass the course. To qualify for a resit, your final grade must be 4.0 or higher. You will receive grades via Blackboard. Assignments (60%) -------------------------------------------------------------------------------- You work on assignments in groups of two. You may discuss your work with other groups, but you may not share any code. It is the responsibility of the team to ensure that both members participate equally. (###) Deadlines The 1-week deadline is hard: prefer submitting half-finished work to missing the dealine. Submisssions scoring >=5.0 may be improved & re-submitted in June. Start working early on the assignments and take advantage of the tutorials to get help. More information about the assignments and submissions coming soon. Written exam (40%) -------------------------------------------------------------------------------- The exam covers all the course material, including the guest lectures. Participation: (bonus, max 5%) -------------------------------------------------------------------------------- Ask questions, give answers, start discussions in class and online, or serve as student representative. Links ================================================================================ * [MS Teams channel](https://teams.microsoft.com/l/team/19%3AiDRSCAKQoTP5fSNaEFc9SmEk_8KzKwYbovBx3mtHdmY1%40thread.tacv2/conversations?groupId=e7169735-a42b-43a6-9417-2d2bac93d92b&tenantId=d72758a0-a446-4e0f-a0aa-4bf95a4a10e7) * [Gitlab Repository](https://git.science.uu.nl/4110161/lbs-24) * [Feedback form](https://docs.google.com/forms/d/e/1FAIpQLSf8ATDWL_1HNRSlqpW1LkMKD5B-nU3gvFAZuBStalG28JaimQ/viewform) * [Rust Book](https://rust-book.cs.brown.edu) * [MyTimetable](https://mytimetable.uu.nl/schedule)