Skip to content

Latest commit

 

History

History
13 lines (7 loc) · 588 Bytes

vulnerable-code-20.md

File metadata and controls

13 lines (7 loc) · 588 Bytes

SecurityExplained S-33: Vulnerable Code Snippet - 20

Vulnerable Code:

Vulnerable Code

Solution:

As per @SonarSource, The problem lies with the server reading 16 bytes on line 13 into its buffer without making sure that the string is null-terminated (the last byte of the buffer is null). Sending 16 non-null bytes to the server will return them and the adjacent buffer containing sensitive data!

Code Credits: SonarSource

Follow Twitter Thread