T09 · Insecure Skill Coding Practices
- Location
scripts/mj_alpha.py:117- Finding
Authenticated Session Cookie Can Be Sent to Arbitrary Configured Endpoints
- Content
View full analysis
dict[str, str]: headers = { "accept": "*/*", "content-type": "application/json", "cookie": config.cookie, "origin": config.origin, "referer": config.origin.rstrip("/") + config.referer_path, "user-agent": config.user_agent, "x-csrf-protection": config.csrf_protection, "x-mj-traceparent": build_traceparent(), } if config.metrics_token: headers["x-metrics-token"] = config.metrics_token headers.update(config.extra_headers) return headers ``` ```python def poll_job( config: MJConfig, job_id: str, *, attempts: int = 60, interval_seconds: float | None = None, once: bool = False, ) -> dict[str, Any]: status_url = resolve_status_url(config.status_url_template, job_id) if not status_url: raise RuntimeError("MJ_STATUS_URL_TEMPLATE is not configured") interval = config.poll_interval_seconds if interval_seconds is None else interval_seconds headers = build_headers(config) history: list[dict[str, Any]] = [] for attempt in range(1, max(1, attempts) + 1): data = get_json(status_url, headers=headers, timeout_seconds=config.timeout_s ...[truncated 2089 chars]- Remediation
View remediation
