Skip to content

[spark-compete] fix: redact SPARK_HOME path from purge safety error message#1421

Open
Esc1200 wants to merge 1 commit into
vibeforge1111:masterfrom
Esc1200:esc1200/fix/launcher-path-leak
Open

[spark-compete] fix: redact SPARK_HOME path from purge safety error message#1421
Esc1200 wants to merge 1 commit into
vibeforge1111:masterfrom
Esc1200:esc1200/fix/launcher-path-leak

Conversation

@Esc1200

@Esc1200 Esc1200 commented Jun 7, 2026

Copy link
Copy Markdown

spark-compete-hotfix-v1

packet: spark-compete-hotfix-v1
team: drophub_sir (esc1200, drophub_sir, spark-agent)
pr_author: Esc1200
repo: vibeforge1111/spark-cli
owner_surface: spark-cli

actual_behavior

safe_spark_home_for_purge in cli.py line 973 raises SystemExit(f"Refusing to purge unsafe Spark home path: {resolved}") which includes the fully resolved internal SPARK_HOME filesystem path in the error message. This leaks the user's home directory layout and internal Spark installation path to stderr.

expected_behavior

The error message should indicate that the purge was refused because the configured Spark home resolves to a system-critical directory, without disclosing the actual filesystem path.

repro_steps

  1. Set SPARK_HOME to the filesystem root, user home, or repo root.
  2. Run spark setup --purge or any command that triggers safe_spark_home_for_purge.
  3. Observe the SystemExit message includes the full resolved path, e.g., Refusing to purge unsafe Spark home path: /home/user.
  4. Note that the internal SPARK_HOME path is exposed in stderr output.

before_after_proof

Before: raise SystemExit(f"Refusing to purge unsafe Spark home path: {resolved}") leaks the full resolved SPARK_HOME path.

After: raise SystemExit("Refusing to purge unsafe Spark home path. The configured Spark home resolves to a system-critical directory.") uses a generic message with no path disclosure.

tests_or_smoke

Verified via git diff that the single-line change replaces the path-leaking f-string with a generic message. Python syntax check passed (lint OK). No new imports required. No control flow change.

duplicate_notes

Searched open PRs and branches for a similar fix to safe_spark_home_for_purge path leak. Related path-leak PRs exist for other surfaces (secret-path-leak, manifest-path-leak, error-explain-path-leak) but none address this specific purge safety error message.

risk_notes

Very low risk. The only change is replacing an f-string error message with a static string. The exception is still raised with the same type (SystemExit). No control flow change. No new imports required.

review_claim

impact_claim: medium
evidence_types: git_diff, lint_check
review_state_requested: pr_review

…essage

safe_spark_home_for_purge leaked the resolved internal SPARK_HOME
path in its SystemExit message. Replace the f-string with a generic
message that preserves the safety intent without disclosing the
filesystem layout.
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