1

For example, would a touchscreen device that uses the below pins on a Raspberry Pi 3 be able to do something more than say, send touch and keyboard events? Anything hackish/nefarious? (edit: use case: just concerned about how careful I should be trusting shield-like peripherals or not... on the computer for example one might be careful about trusting USB, and am wondering if attack vectors are opened depending on the default configuration of the GPIO or alternative protocols through the pins (e.g. what drivers deal with the pins by default)):

                PWR  o o  PWR
  I2C1 SDA / GPIO 2  o o  PWR
                     . .
                     . .
                     . .
                     . .
                     . .
                     . .
                     . .
SPI0 MOSI / GPIO 10  o o  GND
SPI0 MISO / GPIO  9  o o  GPIO 25
SPI0 SCLK / GPIO 11  o o  GPIO 8  / SPI0 CS0
                GND  o o  GPIO 7 / SPI0 CS1
                     . .
                     . .
                     . .
                     . .
                     . .
                     . .
                     . .

Are the alternate functions enabled / autodetected by default, and could those functions like SPI MOSI/MISO be used nefariously, or I2C1 SDA?

If not, do the GPIO pins have any default functionality that can be abused by malicious peripherals?

Thanks.

  • Welcome to the Raspberry Pi flavour corner of the Stack Exchange network. Your question sounds (I hope) as though you are planning a Kiosk type project and have concerns that it might be got-at by members of the unwashed masses - unless you are yourself a black-hat! This sounds like an interesting question and though - apart from the scope of causing actual physical damage to the unit I think there is not much that can be done to harm such a setup - I look forward to seeing what others think... – SlySven Dec 25 '18 at 12:27
  • If they have physical access to the device you have far bigger security issues than the GPIO pins. – Steve Robillard Dec 25 '18 at 13:35
1

What you're proposing is not an attack vector. Each pin has to have a software process behind it (like the kernel SPI driver in your exanple). Unless the attacker can compromise the kernel the GPIO can't be used.

If the kernel is compromised then worse things will be done using easier to hack interfaces like USB.

  • Yes, I was definitely thinking I should be more concerned about USB. However, I was just wondering (limited RPi knowledge) if the default state was exposing specific kernel drivers to the (possibly untrusted) pin input (for example the touchscreen would need to send touch events... not sure if those can go through SPI or would need something higher-level (either directly, or dispatched from, the serial code)). But this is mostly reassuring, thanks! I guess the gist of my question was how much the kernel trusts pin inputs. – hypothesisstack Dec 25 '18 at 13:04
  • Stop worrying about something that isn't a problem. Your bigger problem is that anyone with physical access could change the SDCard and boot something different. In the real world that type of attack won't give any practical benefits to the hacker. So they won't bother. – Dougie Dec 25 '18 at 15:19

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.