An embedded medical device uses a fixed-size buffer of 128 bytes128\text{ bytes}128 bytes to process incoming telemetry packets. The software does not verify the length of the packet before copying it into this buffer. An attacker transmits a packet containing 256 bytes256\text{ bytes}256 bytes, overwriting adjacent memory space containing the program's return addresses and redirecting execution to a malicious payload.
Which vulnerability has been exploited, and what robust programming practice would prevent this?
Vulnerability: SQL Injection; Prevention: Utilising parameterised queries to separate commands from user input.
Vulnerability: Cross-Site Scripting (XSS); Prevention: Sanitising output data before rendering it in a web interface.
Vulnerability: Buffer Overflow; Prevention: Enforcing strict input validation and bounds checking on the packet size.
Vulnerability: Denial of Service (DoS); Prevention: Setting up a network firewall to drop packets originating from unknown IP addresses.
47 exam-style questions on Edexcel GCSE Computer Science Software, covering Purpose of an operating system, Purpose of utility software, and Robust software and identifying vulnerabilities. Each one has a worked solution and a mark scheme showing where the marks go.