mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 19:43:15 +00:00
* fix: enforce a replay window on Linear webhooks (AUTHZ-001) verify_linear_signature accepted any correctly-signed body with no freshness check, so a captured request could be replayed indefinitely. Parse the signed webhookTimestamp (Unix ms) and reject requests outside a 60s window, failing closed when the field is missing or malformed — mirroring the Slack verifier. * fix: stop leaking upstream auth-error bodies into user comments get_github_token_for_user folded the raw upstream response text into the error string that becomes a Slack/Linear comment (AUTH-RESP-LEAK-01). Log the full body server-side only and return a generic "GitHub auth failed (status <code>)". Also document the accepted shared-installation-token blast radius on the bot-token-only path (AUTHZ-003). * fix: bind sandbox and token caches to repo to prevent thread-id collision A PR head-branch name is attacker-controllable and get_thread_id_from_branch derives a thread_id from its first UUID with no repo binding (TID-COLLIDE-01). The in-memory sandbox cache and the per-thread GitHub-token cache were keyed on thread_id alone, and a cached sandbox was reused after only an echo-ping, so a different repo's webhook could bind to another thread's sandbox or token. Without changing the persistent thread-id scheme: - Persist the bound repo (owner/name) in thread metadata on sandbox creation and refuse to reuse a sandbox whose bound repo does not match the current event (SandboxRepoMismatchError); the in-memory proxy also carries the binding. - Bind the GitHub-token cache entries to their repo and evict on a cross-repo read so a colliding thread_id cannot be served another repo's token. - Thread repo through the reviewer and the webhook token resolvers. * fix: scope s3:ListBucket to the releases/ prefix (F-1/IAC-04) The instance role and the GitHub deploy app role granted s3:ListBucket on the whole assets bucket. Every caller (deploy.sh, the publish/rollback scripts) only ever lists under releases/, so add a StringLike s3:prefix=releases/* condition. GetBucketLocation has no s3:prefix in its request context, so it moves to its own unconditioned statement. Also document the accepted F-2 cross-env existence-oracle residual on BatchGetSecretValue. * chore: suppress test-fixture credential false positive; document AUTHZ-002 Add a machine-level suppression for the fake Datadog key in the test_team_credentials encryption-roundtrip fixture (CWE-798, not a real credential). Clarify that the within-org thread-write path is intentional by design (AUTHZ-002) — comment only, no behavior change. * fix: casefold repo-binding keys to avoid spurious cross-repo mismatch GitHub owner/name are case-insensitive. Casefold the owner/name key on both the write (binding) and read (compare) sides — repo_cache_key and the metadata bound_repo read — so Org/Repo and org/repo resolve to one repo and a legitimate same-repo run cannot raise a spurious SandboxRepoMismatchError (Gap 2). * fix: stop leaking upstream auth body in unexpected-result branch The 2xx-but-missing-token/url branch echoed the parsed upstream response body into the user-facing error. Return a generic message and log response_data server-side only, mirroring the existing HTTPStatusError fix (Gap 4). * fix: fail closed for unbound-legacy sandboxes and catch repo mismatch Gap 1: a thread with a persisted sandbox_id but no in-memory cache and no recorded bound_repo (a pre-binding legacy thread, post-deploy) previously reconnected-and-served the sandbox to the current repo, then rebound it. Now fail closed: drop the stale id and recreate a fresh sandbox bound to this repo, logging a reconnect-with-missing-binding event. A sandbox is never served to a repo unless its binding is known and matches; new threads bind on first run unchanged. Gap 3: catch SandboxRepoMismatchError at the agent and reviewer run entrypoints, log it for alarming, and surface a clean sanitized error instead of letting an opaque deep-stack exception crash-loop the worker. * chore: suppress test-fixture credential false positive in token-TTL tests Add a machine-level suppression for the fake "ghp_secret" GitHub token used by the cached-token TTL/revocation unit tests (CWE-798). Not a real credential and not a valid PAT; scoped to the unit test only. |
||
|---|---|---|
| .. | ||
| e2e | ||
| middleware | ||
| conftest.py | ||
| test_account_link.py | ||
| test_agent_instructions.py | ||
| test_agent_schedules.py | ||
| test_agent_subagent_models.py | ||
| test_agent_thread_pr_state.py | ||
| test_agent_usage.py | ||
| test_agents_md.py | ||
| test_analyzer_cron.py | ||
| test_analyzer_skills.py | ||
| test_anthropic_effort.py | ||
| test_api_standards_skill.py | ||
| test_auth_error_leak.py | ||
| test_auth_sources.py | ||
| test_authorship.py | ||
| test_autofix_state.py | ||
| test_autofix_webhook.py | ||
| test_check_message_queue.py | ||
| test_ci_autofix.py | ||
| test_corridor_mcp.py | ||
| test_currents_tools.py | ||
| test_dashboard_admin.py | ||
| test_dashboard_csrf.py | ||
| test_dashboard_links.py | ||
| test_dashboard_org_login_gate.py | ||
| test_dashboard_repo_optional.py | ||
| test_dashboard_repos.py | ||
| test_dashboard_reviews.py | ||
| test_dashboard_run_email.py | ||
| test_dashboard_thread_api.py | ||
| test_dashboard_thread_api_activity.py | ||
| test_dashboard_web_handoff.py | ||
| test_daytona_integration.py | ||
| test_encryption.py | ||
| test_eval_jobs.py | ||
| test_eval_store_reporter.py | ||
| test_fireworks_model.py | ||
| test_github_app.py | ||
| test_github_checks.py | ||
| test_github_ci.py | ||
| test_github_comment_prompts.py | ||
| test_github_feedback.py | ||
| test_github_http.py | ||
| test_github_issue_webhook.py | ||
| test_github_oauth_refresh.py | ||
| test_github_proxy_refresh.py | ||
| test_github_token_ttl.py | ||
| test_google_model.py | ||
| test_http_security.py | ||
| test_langsmith_sandbox_config.py | ||
| test_langsmith_sandbox_timeout.py | ||
| test_langsmith_trace_url.py | ||
| test_linear_webhook_replay.py | ||
| test_local_integration.py | ||
| test_model_fallback_middleware.py | ||
| test_model_fallback_resolution.py | ||
| test_multimodal.py | ||
| test_normalize_repo.py | ||
| test_notify_step_limit_middleware.py | ||
| test_notion_oauth.py | ||
| test_observability_tools.py | ||
| test_open_pull_request.py | ||
| test_plan_mode.py | ||
| test_plan_review.py | ||
| test_pr_ready_auto_review.py | ||
| test_prompt_default_repo.py | ||
| test_proxy_auth.py | ||
| test_public_repo_org_gate.py | ||
| test_recent_comments.py | ||
| test_refresh_slack_status_middleware.py | ||
| test_repair_orphaned_tool_calls.py | ||
| test_repo_binding_isolation.py | ||
| test_repo_extraction.py | ||
| test_repo_prep.py | ||
| test_repo_snapshots.py | ||
| test_review_api.py | ||
| test_review_chat.py | ||
| test_review_style_collector.py | ||
| test_review_style_sync.py | ||
| test_review_styles_store.py | ||
| test_reviewer.py | ||
| test_reviewer_diff.py | ||
| test_reviewer_eval_run.py | ||
| test_reviewer_eval_target.py | ||
| test_reviewer_findings.py | ||
| test_reviewer_groups.py | ||
| test_reviewer_outcomes.py | ||
| test_reviewer_publish.py | ||
| test_reviewer_reconcile.py | ||
| test_reviewer_tools.py | ||
| test_reviewer_watch.py | ||
| test_sandbox_paths.py | ||
| test_sanitize_thinking_blocks.py | ||
| test_sanitize_tool_inputs.py | ||
| test_schedule_thread_wakeup.py | ||
| test_slack_assistants_status.py | ||
| test_slack_context.py | ||
| test_slack_feedback.py | ||
| test_slack_oauth.py | ||
| test_slack_thread_reply_tool.py | ||
| test_stale_sandbox_creating.py | ||
| test_team_credentials.py | ||
| test_team_settings_grouping.py | ||
| test_team_settings_org_guidelines.py | ||
| test_tool_artifact_middleware.py | ||
| test_user_credentials.py | ||
| test_user_mappings.py | ||