zmap / zgrab2

Fast Go Application Scanner
Other
1.75k stars 307 forks source link

ipp: nameLength should be uint16, not int16 #350

Closed codyprime closed 2 years ago

codyprime commented 2 years ago

nameLength is used for slice allocation. If the value is unmarshaled as a negative value, then a runtime error will occur:

runtime error: makeslice: len out of range

(this commit also includes some minor formatting cleanup)

How to Test

I have been unable to reproduce the incident I encountered again, but you can attempt scanning an IPP service found on Censys to verify there has not been a regression: https://search.censys.io/search?resource=hosts&sort=RELEVANCE&per_page=25&virtual_hosts=EXCLUDE&q=services.service_name%3A+IPP

Notes & Caveats

Issue Tracking

elliotcubit commented 2 years ago

Looks good to me, formatting changes only whitespace and this should be unsigned