Skip to content
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

Add mitigation for log injection #2237

Closed
wants to merge 4 commits into from
Closed

Conversation

junorouse
Copy link

@junorouse junorouse commented Feb 19, 2020

Hello, I add a mitigation for log injection. It prevents that malicious user to do a log injection.

Before

$ curl --request "POST" "http://127.0.0.1:3000/%0a[GIN]%20..%20blahblah"

-->

[GIN] 2020/02/19 - 15:35:08 | 401 |     712.772µs |       127.0.0.1 | POST     /
[GIN] .. blahblah

After

$ curl --request "POST" "http://127.0.0.1:3000/%0a[GIN]%20..%20blahblah"

-->

[GIN] 2020/02/19 - 15:36:56 | 401 |     814.381µs |       127.0.0.1 | POST     "/\n[GIN] .. blahblah"

Thanks.

References

https://www.geeksforgeeks.org/log-injection/
https://golang.org/pkg/fmt/

@appleboy appleboy added this to the 1.6 milestone Feb 21, 2020
Copy link
Member

@thinkerou thinkerou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thinkerou
Copy link
Member

why pending? @appleboy do you know?

@appleboy
Copy link
Member

@thinkerou I don't know. Maybe we should push a new commit to trigger Travis again.

thinkerou added a commit that referenced this pull request Feb 26, 2020
@thinkerou
Copy link
Member

@appleboy ok please review #2265 , thanks @junorouse again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants