Skip to content

Conversation

goodov
Copy link
Collaborator

@goodov goodov commented Apr 16, 2025

No description provided.

http.HandleFunc("/up", handler.HandleUpstreamRequest)
http.HandleFunc("/down", handler.HandleDownstreamRequest)

http.ListenAndServe(c.String("listen-address"), nil)

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] The profiling 'pprof' endpoint is automatically exposed on /debug/pprof. This could leak information about the server. Instead, use import "net/http/pprof". See https://www.farsightsecurity.com/blog/txt-record/go-remote-profiling-20161028/ for more information and mitigation.

Source: https://semgrep.dev/r/go.lang.security.audit.net.pprof.pprof-debug-exposure


Cc @thypon @kdenhartog

return
}
binary.Write(w, binary.BigEndian, uint32(len(bytes)))
w.Write(bytes)

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Detected directly writing or similar in 'http.ResponseWriter.write()'. This bypasses HTML escaping that prevents cross-site scripting vulnerabilities. Instead, use the 'html/template' package and render data using 'template.Execute()'.

Source: https://semgrep.dev/r/go.lang.security.audit.xss.no-direct-write-to-responsewriter.no-direct-write-to-responsewriter


Cc @thypon @kdenhartog

return
}
}
}

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Potential wsConn nil dereference when SetCloseHandler is called

Source: https://semgrep.dev/r/trailofbits.go.nil-check-after-call.nil-check-after-call


Cc @thypon @kdenhartog

return
}
}
}

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Potential wsConn nil dereference when SetPongHandler is called

Source: https://semgrep.dev/r/trailofbits.go.nil-check-after-call.nil-check-after-call


Cc @thypon @kdenhartog

return
}
}
}

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Potential wsConn nil dereference when SetReadDeadline is called

Source: https://semgrep.dev/r/trailofbits.go.nil-check-after-call.nil-check-after-call


Cc @thypon @kdenhartog

return
}
}
}

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Potential wsConn nil dereference when SetReadLimit is called

Source: https://semgrep.dev/r/trailofbits.go.nil-check-after-call.nil-check-after-call


Cc @thypon @kdenhartog

return
}
}
}

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Potential wsConn nil dereference when SetWriteDeadline is called

Source: https://semgrep.dev/r/trailofbits.go.nil-check-after-call.nil-check-after-call


Cc @thypon @kdenhartog

}
return nil
},
)

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Potential wsConn nil dereference when SetReadDeadline is called

Source: https://semgrep.dev/r/trailofbits.go.nil-check-after-call.nil-check-after-call


Cc @thypon @kdenhartog

}
return nil
},
)

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Potential wsConn nil dereference when SetReadLimit is called

Source: https://semgrep.dev/r/trailofbits.go.nil-check-after-call.nil-check-after-call


Cc @thypon @kdenhartog

}
return nil
},
)

Choose a reason for hiding this comment

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

reported by reviewdog 🐶
[semgrep] Potential wsConn nil dereference when SetWriteDeadline is called

Source: https://semgrep.dev/r/trailofbits.go.nil-check-after-call.nil-check-after-call


Cc @thypon @kdenhartog

@kdenhartog
Copy link
Member

@goodov is this something that you're writing up with the intent to productionize it or just experimenting with a feature?

If it's intended to be productionized, I can go through the sec alerts and provide suggestions if needed.

@goodov
Copy link
Collaborator Author

goodov commented Apr 22, 2025

@goodov is this something that you're writing up with the intent to productionize it or just experimenting with a feature?

If it's intended to be productionized, I can go through the sec alerts and provide suggestions if needed.

yes, this is intended to be productionized. We're waiting for a vendor to solve some issues on their side before rolling this.

Please, I would love to hear suggestions!

@kdenhartog
Copy link
Member

Sounds good, I'll come back to this tomorrow morning.

@goodov goodov marked this pull request as ready for review April 28, 2025 09:07
Copy link

@thypon thypon left a comment

Choose a reason for hiding this comment

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

Do we already have?

  • WebSocket origin validation for every connection
  • file-size maximum for input files
  • some form of rate-limiting

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.

3 participants