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

checker: go_pprof_endpoint_automatic_exposure #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Thiru-moorthi
Copy link

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

Description

This PR introduces a Go checker that detects imports of the net/http/pprof package, which automatically exposes the /debug/pprof endpoint.

Detection Logic

The checker flags instances where the "net/http/pprof" package is imported, even with a blank identifier.

Why is this a problem?

  • Information Disclosure: Exposes runtime details (goroutines, heap, CPU profiles) that attackers can exploit.
  • Production Risk: Accessible endpoints can leak sensitive operational data.
  • Security Concern: Profiling information should not be publicly exposed in production environments.

Remediation Steps

Option 1: Remove in Production

Use build tags to include pprof only in non-production builds:

//go:build debug
import _ "net/http/pprof"

Exclusions

test/**,*_test.rb,tests/**,__tests__/**

References

pprof security considerations

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 0:50am

@Thiru-moorthi Thiru-moorthi force-pushed the go_pprof_endpoint_automatic_exposure branch from a73cf3b to 07f11c2 Compare February 25, 2025 12:49
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.

1 participant