-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vulnerabilities CWE-113 (issue #4208 issue #4209) #4210
Conversation
Ran SAST(Contrast) and checked that vulnerabilities were fixed. |
Hi guys. Pls check my PR. |
agreementbot/api.go
Outdated
"sort" | ||
"sync" | ||
"time" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you undo the changes in import? Same for api/api.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@omordyk Please see the above comment, the rest looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks
agreementbot/api.go
Outdated
if !isValidInput(input) { | ||
http.Error(w, "Invalid input", http.StatusBadRequest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the error message be more specific?
Same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, Thanks.
74b5207
to
61745d6
Compare
@omordyk Please combine your commits into 1 commit, thanks |
Signed-off-by: Oleksandr Mordyk <[email protected]>
cac2bf0
to
c2f60bd
Compare
Description
Software places user-controlled input in HTTP headers. An attacker could inject line separators (CR/LF sequences) that could split the response message generated by the software into two messages. The second response is completely under the control of the attacker (intermediate web proxies may cache it), with could produce multiple conditions (web defacement, cache poisoning, cross-site scripting or page hijacking, see CWE-113 for full details). If software needs to generate HTTP headers depending on user-controlled input, such input should be properly neutralized (a white-list validation excluding CR/LF is recommended). Please note that cookies are received and sent in 'Cookie' header in HTTP messages, so if the software generates a Cookie from user input, the input should be properly validated as well.
issue #4208
issue #4209
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
make and make test
Checklist: