Skip to content

feat(audit): complete Paket H hardening pass - #17

Merged
TimInTech merged 7 commits into
mainfrom
feat/paket-h-audit-hardening
Jun 21, 2026
Merged

feat(audit): complete Paket H hardening pass#17
TimInTech merged 7 commits into
mainfrom
feat/paket-h-audit-hardening

Conversation

@TimInTech

Copy link
Copy Markdown
Owner

Summary

Implements Paket H audit hardening with verified low-risk fixes and one intentional defer.

Included

  • H1: split broad config load exception handling into debuggable specific cases
  • H2: harden run.sh secrets sourcing with ownership/permission checks while keeping safe source behavior
  • H3: add Path(...).resolve() defense-in-depth in transcription path handling
  • H4: replace production MagicMock fallback with a small null client stub
  • H6: make PasteService key delay configurable and wire it through app init/runtime updates
  • H7: localize CUDA_VISIBLE_DEVICES override to the OpenAI Whisper call and restore it afterwards
  • H8: collapse duplicate default-model source to a single source of truth in config
  • H9: verify OpenAI TTS voice allowlist; keep marin and cedar because they are valid in the installed client

Deferred intentionally

  • H5 remains open by design: no reproduced bug, no strong red test, and no evidence of a real busy-loop beyond the existing select(..., 1.0) and fd cleanup behavior

Verification

  • ./.venv/bin/python -m pytest -q
    • Result: 252 passed, 18 skipped

Notes

  • This branch does not adopt the audit suggestion to parse secrets via grep | xargs, because that would break values with spaces or special characters.
  • ROADMAP has been updated to reflect the current Paket H status.

@TimInTech
TimInTech merged commit d2618c5 into main Jun 21, 2026
7 checks passed
@TimInTech
TimInTech deleted the feat/paket-h-audit-hardening branch June 21, 2026 02:37

@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: c4fc62e31e

ℹ️ 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 +119 to 121
except OSError:
logger.warning("Config file could not be read, using defaults", exc_info=True)
return _deep_merge(DEFAULTS, {})

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 Catch non-UTF-8 config files during fallback

If config.json exists but contains invalid UTF-8 bytes, Path.read_text(encoding="utf-8") raises UnicodeDecodeError, which is not a json.JSONDecodeError or OSError. Before this change the broad handler fell back to defaults, but now app startup via BlitztextConfig(...) crashes instead of recovering from a corrupt hand-edited config file.

Useful? React with 👍 / 👎.

Comment thread run.sh
Comment on lines +30 to +31
if [[ -n "${SECRETS_PERMS}" ]] && (( 10#${SECRETS_PERMS} > 600 )); then
echo "WARNUNG: ${SECRETS_FILE} hat zu offene Rechte (${SECRETS_PERMS}); erwartet 600 oder restriktiver." >&2

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 Check group/other bits instead of numeric mode order

For permission modes like 0440 or 0040, the secrets file is group-readable but 10#${SECRETS_PERMS} > 600 is false, so run.sh sources it without the intended warning. Since the hardening is meant to warn for anything looser than owner-only access, this needs to test group/other permission bits rather than compare the octal string as a decimal number.

Useful? React with 👍 / 👎.

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