Skip to content

fix: harden debug logging and LLM endpoint validation - #57

Merged
TimInTech merged 3 commits into
mainfrom
fix/security-debuglog-http-endpoints
Aug 31, 2026
Merged

fix: harden debug logging and LLM endpoint validation#57
TimInTech merged 3 commits into
mainfrom
fix/security-debuglog-http-endpoints

Conversation

@TimInTech

Copy link
Copy Markdown
Owner

Security fixes

  • Removes arbitrary key-event data from DEBUG logs.
  • Rejects public HTTP LLM endpoints while retaining exact localhost, loopback, and RFC1918 IPv4 literals for local HTTP use.
  • Clears unsafe legacy endpoint values and presents a visible settings warning.
  • Corrects related security, privacy, and support documentation.

Verification

  • 571 passed, 2 skipped, 0 failed
  • git diff --check clean
  • Independent read-only patch review completed; the follow-up URL-parser fix was re-reviewed.

No secrets, raw logs, or sensitive input are included.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b9b94f919

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/config.py
Comment on lines +508 to +510
except ValueError:
self._data["llm_base_url"] = ""
self._has_unsafe_llm_base_url = True

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Block migrated endpoints instead of defaulting to OpenAI

When a legacy custom or openrouter configuration contains a public HTTP URL and an API key is set, clearing only llm_base_url leaves the non-OpenAI provider selected. _build_llm_service() then passes the empty URL to LLMService, which converts it to base_url=None; the OpenAI SDK consequently uses its default OpenAI endpoint. An LLM workflow can therefore send the transcript and custom-provider credential to OpenAI before the user ever sees the settings warning. Preserve an explicit blocked state or otherwise prevent requests until the user supplies a valid endpoint.

Useful? React with 👍 / 👎.

Comment thread app/config.py
Comment on lines +581 to +584
try:
address = ipaddress.ip_address(hostname)
except ValueError as exc:
raise ValueError("LLM base URL requires HTTPS for non-local endpoints") from exc

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate the endpoint before mutating the live configuration

When a user enters a public HTTP endpoint, this new exception is raised only after SettingsDialog.save_settings() has already assigned the model, backend, language, hotkey, API-key environment, and provider to the shared config object. The error dialog prevents saving and acceptance, but it does not roll those assignments back; cancelling afterward leaves partial settings active in memory, and a later preset change calls config.save() and persists them. Validate the URL before any assignments or stage changes in a copy until all validation succeeds.

Useful? React with 👍 / 👎.

@TimInTech
TimInTech merged commit b3d109a into main Aug 31, 2026
9 checks passed
@TimInTech
TimInTech deleted the fix/security-debuglog-http-endpoints branch August 31, 2026 11:07
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