[spark-compete] fix: remove SPARK_APPROVAL_ENFORCE bypass in secret fetching - #846
Open
yossweh wants to merge 2 commits into
Open
[spark-compete] fix: remove SPARK_APPROVAL_ENFORCE bypass in secret fetching#846yossweh wants to merge 2 commits into
yossweh wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[spark-compete] fix: remove SPARK_APPROVAL_ENFORCE bypass in secret fetching
pr_author: yossweh
repo: vibeforge1111/spark-telegram-bot
branch: fix/approval-enforce-bypass-in-secret-fetch
actual_behavior
readSparkSecretViaPythonBridge()insrc/profileEnv.ts:99explicitly setsSPARK_APPROVAL_ENFORCE: '0'in the environment when calling the Python CLI to fetch secrets. This bypasses the approval enforcement mechanism that the Python CLI'sfetch_secret()function checks. Any secret fetched via this code path skips the approval workflow entirely.expected_behavior
The function should inherit the process environment as-is, allowing the Python CLI to respect the configured approval enforcement policy. If
SPARK_APPROVAL_ENFORCEis set in the process env, it should be honored; if not set, the Python CLI's default behavior should apply.public-safe proof of the exact failure
Before (current main):
After (this PR):
trust boundary touched by this change
Surface: Secret fetching via Python CLI bridge in
readSparkSecretViaPythonBridge()Boundary change: Removes explicit bypass of approval enforcement; Python CLI now respects configured policy
What this does NOT change:
targeted tests / smoke checks
npm run buildrisk notes
Which risky surface changed: Secret access path
Why the change is necessary: The bypass defeats the approval enforcement security control for secret access
Secrets: No secrets introduced; changes how existing secrets are accessed
Auth / session state: No changes to session or auth flow
Dependency / runtime behavior: No new deps
File / network access: No changes
Prompt / tool execution: No changes
Rollback: Single-file revert (one line change)
What reviewers / lab still need to verify: Confirm Python CLI's approval enforcement works correctly when SPARK_APPROVAL_ENFORCE is not explicitly set to '0'
duplicate_notes
Checked open PRs in spark-telegram-bot — no existing PR addresses the SPARK_APPROVAL_ENFORCE bypass in profileEnv.ts. PR #843 is about SSRF in previewUrl (different issue). This fix specifically targets the approval enforcement bypass in the secret fetching code path.
review_claim
team
hellenagent (hellen, yossweh, exelchapo) — llm_device_holder: yossweh
packet
{ "schema": "spark-compete-hotfix-v1", "event": "spark-compete-first-event", "submission_mode": "public_repo_pr", "submission_target_url": "https://github.com/vibeforge1111/spark-telegram-bot/pull/846", "team": { "name": "hellenagent", "members": [ "hellen", "yossweh", "exelchapo" ], "github_accounts": [ "yossweh" ], "llm_device_holder": "yossweh", "device_holder_github": "yossweh" }, "target_repo": { "id": "vibeforge1111/spark-telegram-bot", "source": "https://github.com/vibeforge1111/spark-telegram-bot", "owner_surface": "telegram-bot" }, "issue": { "type": "bug", "title": "SPARK_APPROVAL_ENFORCE bypass in secret fetching", "severity": "medium", "affected_workflow": "secret fetching via Python CLI bridge", "actual_behavior": "readSparkSecretViaPythonBridge() explicitly sets SPARK_APPROVAL_ENFORCE=0, bypassing the approval enforcement mechanism for all secret access via this code path", "expected_behavior": "Secret fetching should respect the configured approval enforcement policy, not bypass it", "repro_steps": [ "Set SPARK_APPROVAL_ENFORCE=1 in environment", "Call readSparkSecretViaPythonBridge()", "Observe that SPARK_APPROVAL_ENFORCE=0 is passed to the Python CLI subprocess", "Secret is fetched without approval enforcement" ] }, "evidence": { "links": [ "https://github.com/vibeforge1111/spark-telegram-bot/pull/846" ], "forbidden": [ "do not include secret values", "do not include env file contents" ], "safe_links_only": true, "before_after_proof": "Before: env: { ...process.env, SPARK_APPROVAL_ENFORCE: '0' }. After: env: process.env." }, "proposed_fix": { "approach": "Remove the SPARK_APPROVAL_ENFORCE: '0' override from readSparkSecretViaPythonBridge(), inherit process.env as-is so the Python CLI respects the configured approval enforcement policy.", "files_expected": [ "src/profileEnv.ts" ], "tests_or_smoke": "npm run build passes. Verify Python CLI receives the correct SPARK_APPROVAL_ENFORCE value from process.env." }, "pr": { "url": "https://github.com/vibeforge1111/spark-telegram-bot/pull/846", "branch": "fix/approval-enforce-bypass-in-secret-fetch", "title_prefix": "[spark-compete]", "author_github": "yossweh", "body_must_include": [ "packet", "team", "pr_author", "repo", "actual_behavior", "expected_behavior", "repro_steps", "before_after_proof", "tests_or_smoke", "duplicate_notes", "risk_notes", "review_claim" ] }, "review_claim": { "impact_claim": "medium", "evidence_types": [ "redacted_terminal_excerpt", "smoke_test", "redacted_conversation_excerpt" ], "review_state_requested": "pr_review", "duplicate_notes": "No existing PR addresses SPARK_APPROVAL_ENFORCE bypass. PR #843 is about SSRF in previewUrl (different issue).", "risk_notes": "One-line change removing approval bypass. No new deps. Single-file revert. Reviewers should verify Python CLI approval enforcement works when env var is not overridden." } }