Last year, private researchers CT scanned many apple's Thunderbolt 4 connectors and were astonished to find a 10-layer PCB with lots of active electronics.
A lot of people saw the scan and wondered whether malicious electronics could be hidden in a tiny USB connector
and the answer is YES.
It can even look like an ordinary USB cable (video on the right), but it can log keystrokes, inject malicious code, and communicate with an attacker via WiFi, etc.
You can explore the scans for yourself!