Skip to content

checker: go_cgi_import#73

Merged
sourya-deepsource merged 1 commit intoDeepSourceCorp:masterfrom
Thiru-moorthi:go_cgi_import
Mar 7, 2025
Merged

checker: go_cgi_import#73
sourya-deepsource merged 1 commit intoDeepSourceCorp:masterfrom
Thiru-moorthi:go_cgi_import

Conversation

@Thiru-moorthi
Copy link
Contributor

@Thiru-moorthi Thiru-moorthi commented Feb 24, 2025

Description

This PR adds a new Go checker to detect the usage of the deprecated and insecure net/http/cgi package.

Detection Logic

This checker flags instances where:

  • The net/http/cgi package is imported in Go source files.

Impact

The net/http/cgi package is deprecated and insecure, posing risks such as:

  • Command Injection: CGI-based applications are more susceptible to command injection attacks.
  • Performance Issues: CGI introduces additional process creation overhead, making it inefficient compared to modern web frameworks.
  • Outdated Architecture: Modern web development favors more secure and scalable alternatives, such as HTTP handlers and middleware.

Recommended Alternative

Instead of net/http/cgi, use the net/http package to build modern, secure HTTP servers.

Insecure Example:
import "net/http/cgi"
Secure Example:
import "net/http"

Exclusions

To reduce noise, this checker does not flag occurrences in:

  • Test files (test/**, *_test.go, tests/**, __tests__/**)

References

@vercel
Copy link

vercel bot commented Feb 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
globstar ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 4:57pm

@sourya-deepsource sourya-deepsource merged commit 7c83be9 into DeepSourceCorp:master Mar 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants