Skip to content

Move from panic to error in doc-gen main.go#6694

Open
tomaioo wants to merge 1 commit into
apache:mainfrom
tomaioo:fix/security/use-of-panic-in-doc-gen-main-go
Open

Move from panic to error in doc-gen main.go#6694
tomaioo wants to merge 1 commit into
apache:mainfrom
tomaioo:fix/security/use-of-panic-in-doc-gen-main-go

Conversation

@tomaioo

@tomaioo tomaioo commented Jun 21, 2026

Copy link
Copy Markdown

Summary

Security: Use of panic in doc-gen main.go

Problem

Severity: Low | File: cmd/util/doc-gen/main.go:L42

The main.go in cmd/util/doc-gen uses panic(err) for error handling, which can cause abrupt program termination and may leak sensitive information in stack traces if the error contains internal paths or configuration details.

Solution

Replace panic(err) with proper error handling that logs the error and exits gracefully with a non-zero status code, avoiding stack trace exposure.

Changes

  • cmd/util/doc-gen/main.go (modified)

The `main.go` in `cmd/util/doc-gen` uses `panic(err)` for error handling, which can cause abrupt program termination and may leak sensitive information in stack traces if the error contains internal paths or configuration details.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>

@squakez squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, this is fine. However, the panic was not a big problem, given that the tool is only executed for development purposes by project contributors. Not really a security issue at all.

@squakez squakez changed the title Security: Use of panic in doc-gen main.go Move from panic to error in doc-gen main.go Jun 22, 2026
@squakez

squakez commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

please rebase, there was some issue on main

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