hermes-agent/tools
Teknium 674e16e7c6
fix(redact): stop DB-connstr redaction from corrupting code output (#33801) (#54061)
Secret redaction is display/output-scoped on main — write_file writes
content verbatim, terminal/execute_code redact only output not the
command/source. The real bug is in displayed tool OUTPUT (read_file,
terminal, execute_code):

_DB_CONNSTR_RE's password group [^@]+ was greedy across newlines, so on a
multi-line block it scanned past the DSN line to the next stray '@' (a
Python @decorator), replacing every intervening character — including line
breaks — with ***. That dropped lines and concatenated the next line onto
the f-string line, making read_file output look corrupted (the file on disk
was always correct). Reported in #33801.

Fix:
- Forbid whitespace in the userinfo/password groups ([^:\s]+ / [^@\s]+) so
  the match can never span a line break. A real DSN password never contains
  whitespace. This alone kills the catastrophic line-dropping.
- Under code_file=True, preserve a password group that is a pure {...} brace
  expression — f"postgresql://{user}:{pass}@{host}" is an f-string template,
  not a live credential. Literal passwords are still masked.
- Pass code_file=True at the terminal and execute_code output redaction call
  sites (file_tools already did) so code-execution output isn't corrupted by
  ENV/JSON/template false positives. Real prefixes, auth headers, JWTs, and
  private keys are still redacted.

Verified E2E against the reporter's exact pydantic-settings module: file
written verbatim, read_file shows the DSN f-string + @model_validator intact
with zero *** corruption, while a literal postgresql://admin:pw@host DSN and
a real sk- key are still masked.

Reported-by: koishi70
Reported-by: pfrenssen
2026-06-28 01:15:39 -07:00
..
computer_use revert(windows): roll back terminal-popup PRs #53791 #53810 #53829 (#53853) 2026-06-27 15:59:00 -07:00
environments fix(security): centralize credential-safe subprocess env (#29157) 2026-06-27 20:45:31 -07:00
neutts_samples
…
__init__.py
…
ansi_strip.py
…
approval.py fix(approval): honour tirith_fail_open=false on Tirith ImportError (#20733) 2026-06-27 04:41:24 -07:00
async_delegation.py
…
binary_extensions.py
…
blueprints.py
…
browser_camofox.py
…
browser_camofox_state.py
…
browser_cdp_tool.py
…
browser_dialog_tool.py
…
browser_supervisor.py
…
browser_tool.py fix: defer hermes_subprocess_env import in browser_tool 2026-06-27 20:45:31 -07:00
budget_config.py
…
checkpoint_manager.py revert(windows): roll back terminal-popup PRs #53791 #53810 #53829 (#53853) 2026-06-27 15:59:00 -07:00
clarify_gateway.py fix(clarify): raise default clarify_timeout to 3600s (#32762) 2026-06-28 01:07:53 -07:00
clarify_tool.py
…
code_execution_tool.py fix(redact): stop DB-connstr redaction from corrupting code output (#33801) (#54061) 2026-06-28 01:15:39 -07:00
computer_use_tool.py
…
credential_files.py
…
cronjob_tools.py
…
debug_helpers.py
…
delegate_tool.py fix: drop isinstance(str) guard so client.base_url fallback works with httpx.URL 2026-06-27 03:59:36 +05:30
discord_tool.py
…
env_passthrough.py
…
env_probe.py
…
fal_common.py
…
feishu_doc_tool.py
…
feishu_drive_tool.py
…
file_operations.py
…
file_state.py
…
file_tools.py fix(file-ops): keep worktree isolation when restoring preserved cwd (#26211) 2026-06-27 19:29:06 -07:00
fuzzy_match.py
…
homeassistant_tool.py
…
image_generation_tool.py
…
interrupt.py
…
kanban_tools.py
…
lazy_deps.py fix(security): centralize credential-safe subprocess env (#29157) 2026-06-27 20:45:31 -07:00
managed_tool_gateway.py
…
mcp_oauth.py fix(mcp): suppress interactive OAuth stdin prompts during background discovery (#35927) 2026-06-27 04:59:23 +05:30
mcp_oauth_manager.py
…
mcp_tool.py fix(mcp): never permanently wedge the circuit breaker on a dead transport (#53599) 2026-06-27 04:39:54 -07:00
memory_tool.py
…
microsoft_graph_auth.py
…
microsoft_graph_client.py
…
neutts_synth.py
…
openrouter_client.py
…
osv_check.py
…
patch_parser.py
…
path_security.py
…
process_registry.py fix(gateway): make bg-process reset TTL configurable + surface session-scoped processes 2026-06-27 20:45:43 -07:00
project_tools.py
…
read_extract.py
…
read_terminal_tool.py
…
registry.py fix(tools): suppress transient check_fn flakes so subagents keep file/terminal tools 2026-06-27 19:29:00 -07:00
schema_sanitizer.py
…
send_message_tool.py test+harden: modernize salvaged Matrix path for current plugin layout 2026-06-28 12:48:08 +05:30
session_search_tool.py fix(session_search): demote cron below interactive sessions in discover ranking (#53597) 2026-06-27 04:41:22 -07:00
skill_manager_tool.py fix(curator): fail closed on unverified skill deletes during consolidation (#53935) 2026-06-27 20:45:57 -07:00
skill_provenance.py
…
skill_usage.py
…
skills_ast_audit.py
…
skills_guard.py
…
skills_hub.py revert(windows): roll back terminal-popup PRs #53791 #53810 #53829 (#53853) 2026-06-27 15:59:00 -07:00
skills_sync.py fix(skills): skip shadowing when external_dirs provides the skill 2026-06-27 21:07:53 -07:00
skills_tool.py
…
slash_confirm.py
…
terminal_tool.py fix(redact): stop DB-connstr redaction from corrupting code output (#33801) (#54061) 2026-06-28 01:15:39 -07:00
thread_context.py
…
threat_patterns.py
…
tirith_security.py
…
todo_tool.py
…
tool_backend_helpers.py
…
tool_output_limits.py
…
tool_result_storage.py
…
tool_search.py
…
transcription_tools.py revert(windows): roll back terminal-popup PRs #53791 #53810 #53829 (#53853) 2026-06-27 15:59:00 -07:00
tts_tool.py revert(windows): roll back terminal-popup PRs #53791 #53810 #53829 (#53853) 2026-06-27 15:59:00 -07:00
url_safety.py
…
video_generation_tool.py
…
vision_tools.py
…
voice_mode.py
…
web_tools.py
…
website_policy.py
…
write_approval.py
…
x_search_tool.py
…
xai_http.py
…
yuanbao_tools.py
…