{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,11,10]],"date-time":"2026-11-10T17:52:56Z","timestamp":1794333176741,"version":"4.9.0"},"reference-count":33,"publisher":"MDPI AG","issue":"6","license":[{"start":{"date-parts":[[2023,6,19]],"date-time":"2023-06-19T00:00:00Z","timestamp":1687132800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100002347","name":"Federal Ministry of Education and Research","doi-asserted-by":"publisher","award":["01IS18065E"],"award-info":[{"award-number":["01IS18065E"]}],"id":[{"id":"10.13039\/501100002347","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Future Internet"],"abstract":"<jats:p>With the increasing popularity of IoT (Internet-of-Things) devices, their security becomes an increasingly important issue. Buffer overflow vulnerabilities have been known for decades, but are still relevant, especially for embedded devices where certain security measures cannot be implemented due to hardware restrictions or simply due to their impact on performance. Therefore, many buffer overflow detection mechanisms check for overflows only before critical data are used. All data that an attacker could use for his own purposes can be considered critical. It is, therefore, essential that all critical data are checked between writing a buffer and its usage. This paper presents a vulnerability of the ESP32 microcontroller, used in millions of IoT devices, that is based on a pointer that is not protected by classic buffer overflow detection mechanisms such as Stack Canaries or Shadow Stacks. This paper discusses the implications of vulnerability and presents mitigation techniques, including a patch, that fixes the vulnerability. The overhead of the patch is evaluated using simulation as well as an ESP32-WROVER-E development board. We showed that, in the simulation with 32 general-purpose registers, the overhead for the CoreMark benchmark ranges between 0.1% and 0.4%. On the ESP32, which uses an Xtensa LX6 core with 64 general-purpose registers, the overhead went down to below 0.01%. A worst-case scenario, modeled by a synthetic benchmark, showed overheads up to 9.68%.<\/jats:p>","DOI":"10.3390\/fi15060217","type":"journal-article","created":{"date-parts":[[2023,6,20]],"date-time":"2023-06-20T01:37:38Z","timestamp":1687225058000},"page":"217","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":7,"title":["Through the Window: Exploitation and Countermeasures of the ESP32 Register Window Overflow"],"prefix":"10.3390","volume":"15","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-3274-2469","authenticated-orcid":false,"given":"Kai","family":"Lehniger","sequence":"first","affiliation":[{"name":"IHP\u2014Leibniz-Institut f\u00fcr Innovative Mikroelektronik, 15236 Frankfurt (Oder), Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-6209-9048","authenticated-orcid":false,"given":"Peter","family":"Langend\u00f6rfer","sequence":"additional","affiliation":[{"name":"IHP\u2014Leibniz-Institut f\u00fcr Innovative Mikroelektronik, 15236 Frankfurt (Oder), Germany"},{"name":"BTU Cottbus-Senftenberg, 03046 Cottbus, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2023,6,19]]},"reference":[{"key":"ref_1","unstructured":"Cadence Design Systems, Inc. (2019). Xtensa Instruction Set Architecture (ISA) Reference Manual, Cadence Design Systems, Inc."},{"key":"ref_2","unstructured":"Cadence Design Systems, Inc. (2018). Xtensa Microprocessor Programmer\u2019s Guide, Cadence Design Systems, Inc."},{"key":"ref_3","unstructured":"Trost, A., \u017demva, A., and Skavhaug, A. (2020, January 26\u201328). Challenges of Return-Oriented-Programming on the Xtensa Hardware Architecture. Proceedings of the Euromicro Conference on Digital System Design, Kranj, Slovenia."},{"key":"ref_4","doi-asserted-by":"crossref","unstructured":"Amatov, B., Lehniger, K., and Langend\u00f6rfer, P. (2022, January 21\u201325). Return-Oriented Programming Gadget Catalog for the Xtensa Architecture. Proceedings of the 2022 IEEE International Conference on Pervasive Computing and Communications Workshops and Other Affiliated Events (PerCom Workshops), Pisa, Italy.","DOI":"10.1109\/PerComWorkshops53856.2022.9767489"},{"key":"ref_5","unstructured":"Shacham, H. (October, January 2). The geometry of innocent flesh on the bone: Return-into-libc without function calls (on the x86). Proceedings of the 14th ACM Conference on Computer and Communications Security, Alexandria, VA, USA."},{"key":"ref_6","unstructured":"Perry, W., and Crispin, C. (2003, January 25\u201327). Simple Stack Smash Protection for GCC. Proceedings of the GCC Developers Summit, Ottawa, ON, Canada."},{"key":"ref_7","doi-asserted-by":"crossref","unstructured":"Lehniger, K., and Langend\u00f6rfer, P. (December, January 30). Through the Window: On the exploitability of Xtensa\u2019s Register Window Overflow. Proceedings of the 2022 32nd International Telecommunication Networks and Applications Conference (ITNAC), Wellington, New Zealand.","DOI":"10.1109\/ITNAC55475.2022.9998407"},{"key":"ref_8","unstructured":"Aleph One (1996). Smashing the stack for fun and profit. Phrack Mag., 7, 14\u201316."},{"key":"ref_9","unstructured":"PaX Team (2023, May 03). Pax Address Space Layout Randomization (aslr). Available online: https:\/\/pax.grsecurity.net\/docs\/aslr.txt."},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/1609956.1609960","article-title":"Control-Flow Integrity: Principles, Implementations, and Applications","volume":"Volume 13","author":"Abadi","year":"2009","journal-title":"ACM Transactions on Information and System Security (TISSEC)"},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"1404","DOI":"10.1109\/TIFS.2011.2159712","article-title":"Comprehensive and Efficient Protection of Kernel Control Data","volume":"6","author":"Li","year":"2011","journal-title":"IEEE Trans. Inf. Forensics Secur."},{"key":"ref_12","unstructured":"Fratri\u0107, I. (2012). ROPGuard: Runtime Prevention of Return-Oriented Programming Attacks: Technical Report, IEEE."},{"key":"ref_13","doi-asserted-by":"crossref","unstructured":"Cheng, Y., Zhou, Z., Miao, Y., Ding, X., and Deng, R.H. (2014). ROPecker: A Generic and Practical Approach for Defending against ROP Attack, Internet Society.","DOI":"10.14722\/ndss.2014.23156"},{"key":"ref_14","unstructured":"Clercq, R.d., and Verbauwhede, I. (2017). A survey of Hardware-based Control Flow Integrity (CFI). arXiv."},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Li, J., Chen, L., Xu, Q., Tian, L., Shi, G., Chen, K., and Meng, D. (2020). Zipper Stack: Shadow Stacks Without Shadow, Springer.","DOI":"10.1007\/978-3-030-58951-6_17"},{"key":"ref_16","unstructured":"Liljestrand, H., Nyman, T., Gunn, L.J., Ekberg, J., and Asokan, N. (2021). PACStack: An Authenticated Call Stack, USENIX Association."},{"key":"ref_17","unstructured":"Salapura, V. (2022, January 18\u201322). PACMAN. Proceedings of the 49th Annual International Symposium on Computer Architecture, New York, NY, USA."},{"key":"ref_18","unstructured":"Cowan, C., Pu, C., Maier, D., Walpole, J., Bakke, P., Beattie, S., Grier, A., Wagle, P., Zhang, Q., and Hinton, H. (1998, January 26\u201329). Stackguard: Automatic adaptive detection and prevention of buffer-overflow attacks. Proceedings of the USENIX Security Symposium, San Antonio, TX, USA."},{"key":"ref_19","unstructured":"Cowan, C., Wagle, F., Calton, P., Beattie, S., and Walpole, J. (2000, January 25\u201327). Buffer overflows: Attacks and defenses for the vulnerability of the decade. Proceedings of the Proceedings DARPA Information Survivability Conference and Exposition. DISCEX\u201900, Hilton Head, SC, USA."},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Bittau, A., Belay, A., Mashtizadeh, A., Mazieres, D., and Boneh, D. (2014, January 18\u201321). Hacking Blind. Proceedings of the 2014 IEEE Symposium on Security and Privacy, Berkeley, CA, USA.","DOI":"10.1109\/SP.2014.22"},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Wang, Z., Ding, X., Pang, C., Guo, J., Zhu, J., and Mao, B. (2018, January 25\u201328). To Detect Stack Buffer Overflow with Polymorphic Canaries. Proceedings of the 2018 48th Annual IEEE\/IFIP International Conference on Dependable Systems and Networks (DSN), Luxembourg.","DOI":"10.1109\/DSN.2018.00035"},{"key":"ref_22","doi-asserted-by":"crossref","unstructured":"Marco-Gisbert, H., and Ripoll, I. (2013, January 22\u201324). Preventing Brute Force Attacks Against Stack Canary Protection on Networking Servers. Proceedings of the 2013 IEEE 12th International Symposium on Network Computing and Applications, Cambridge, MA, USA.","DOI":"10.1109\/NCA.2013.12"},{"key":"ref_23","unstructured":"Frantzen, M., and Shuey, M. (2001). StackGhost: Hardware Facilitated Stack Protection, USENIX Association."},{"key":"ref_24","doi-asserted-by":"crossref","unstructured":"Lehniger, K., and Langendorfer, P. (2022). Window Canaries: Re-thinking Stack Canaries for Architectures with Register Windows. IEEE Trans. Dependable Secur. Comput., 1\u201311.","DOI":"10.1109\/TDSC.2022.3230748"},{"key":"ref_25","doi-asserted-by":"crossref","unstructured":"Burow, N., Zhang, X., and Payer, M. (2019, January 19\u201323). SoK: Shining Light on Shadow Stacks. Proceedings of the 2019 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA.","DOI":"10.1109\/SP.2019.00076"},{"key":"ref_26","unstructured":"(2023, April 04). Instrumentation Options (Using the GNU Compiler Collection (GCC)), 2021-07-28T07:17:14.000Z. Available online: https:\/\/gcc.gnu.org\/onlinedocs\/gcc\/Instrumentation-Options.html."},{"key":"ref_27","unstructured":"(2023, April 04). Clang Command Line Argument Reference\u2014Clang 15.0.0git Documentation, 2022-03-08T06:03:13.000Z. Available online: https:\/\/clang.llvm.org\/docs\/ClangCommandLineReference.html."},{"key":"ref_28","doi-asserted-by":"crossref","first-page":"293","DOI":"10.1007\/978-3-319-99828-2_21","article-title":"Smashing the Stack Protector for Fun and Profit","volume":"Volume 529","author":"Janczewski","year":"2018","journal-title":"ICT Systems Security and Privacy Protection"},{"key":"ref_29","unstructured":"Black, A.P., and Liskov, B. (1993, January 5\u20138). Efficient software-based fault isolation. Proceedings of the Fourteenth ACM Symposium on Operating Systems Principes, Asheville, NC, USA. Operating Systems Review."},{"key":"ref_30","unstructured":"Espressif Ssytems (ESP32 Technical Reference Manual, 2022). ESP32 Technical Reference Manual, version 4.8."},{"key":"ref_31","unstructured":"(2023, April 12). FreeRTOS-MPU\u2014Memory Protection Unit Support in FreeRTOS. Available online: https:\/\/www.freertos.org\/FreeRTOS-MPU-memory-protection-unit.html."},{"key":"ref_32","unstructured":"(2023, April 12). GitHub Apache\/Nuttx esp32_Window_Hooks.s. Available online: https:\/\/github.com\/apache\/nuttx\/blob\/master\/arch\/xtensa\/src\/esp32\/esp32_window_hooks.S."},{"key":"ref_33","unstructured":"EEMBC (2022, March 08). CoreMark. Available online: https:\/\/github.com\/eembc\/coremark."}],"container-title":["Future Internet"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1999-5903\/15\/6\/217\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T19:56:40Z","timestamp":1760126200000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1999-5903\/15\/6\/217"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,6,19]]},"references-count":33,"journal-issue":{"issue":"6","published-online":{"date-parts":[[2023,6]]}},"alternative-id":["fi15060217"],"URL":"https:\/\/doi.org\/10.3390\/fi15060217","relation":{},"ISSN":["1999-5903"],"issn-type":[{"value":"1999-5903","type":"electronic"}],"subject":[],"published":{"date-parts":[[2023,6,19]]}}}