#8621·skyvern

HAR artifacts written unredacted (plaintext session cookies and password form fields) when a run has no workflow secret values

Author: gij-uit-byteCreated Sep 20, 2026Updated Sep 20, 2026
LabelssecurityData Privacy

Summary

HAR artifacts can be written completely unredacted — plaintext session cookies, Cookie / Set-Cookie headers and password form fields — when a run has no workflow-level secret values.

redact_har_bytes() performs name-based redaction that needs no secret values at all (_redact_headers, _redact_cookies, _redact_query_string, _redact_form_fields on postData.params). But in _maybe_redact_artifact_data() that whole function is skipped when secret_values is empty, so HARs from such runs get no redaction whatsoever.

Environment

  • self-hosted, docker compose, commit 2c9eb72 (2026-09-17)
  • CREDENTIAL_VAULT_TYPE=skyvern (default), ENABLE_SECRET_ARTIFACT_REDACTION=true (default)

Reproduction

  1. Serve a trivial login form locally (username + password fields, sets a session cookie on success).
  2. Create a password credential: POST /v1/credentials with credential_type: "password".
  3. Run a login task against it:
POST /v1/run/tasks/login
{"url": "<local login url>", "credential_id": "cred_...", "credential_type": "skyvern"}
  1. Grep the run's har.har artifact for the password.

Expected

The password form field and the session cookie are replaced with [REDACTED_SECRET], as redact_har_bytes() is written to do.

Actual

The HAR contains everything in plaintext, and "REDACTED" in json.dumps(har) is False — i.e. no redaction ran at all:

json
// entries[1].request.postData
{"mimeType": "application/x-www-form-urlencoded", "text": "",
 "params": [{"name": "username", "value": "agent.demo"},
            {"name": "password", "value": "<plaintext password>"}]}
response Set-Cookie:     sid=4ce4252349...; Path=/; HttpOnly
request Cookie header:   sid=4ce4252349...

Note the password field is matched by name (password ∈ SENSITIVE_FORM_FIELD_NAMES), so this does not depend on the value being known as a secret.

Likely cause

skyvern/forge/sdk/artifact/manager.py, _maybe_redact_artifact_data() (lines 109–122 at 2c9eb72):

python
if not app.WORKFLOW_CONTEXT_MANAGER.artifact_redaction_enabled(resolved_workflow_run_id):
    if artifact_type not in (ArtifactType.HAR, ArtifactType.BROWSER_CONSOLE_LOG):
        return data
    secret_values = app.WORKFLOW_CONTEXT_MANAGER.runtime_secret_values_for_artifacts()
    if not secret_values:
        return data          # <-- HAR returns here, redact_har_bytes() never runs
else:
    secret_values = app.WORKFLOW_CONTEXT_MANAGER.get_secret_values_for_run(resolved_workflow_run_id)
if artifact_type == ArtifactType.HAR:
    return redact_har_bytes(data, secret_values)

For a task-style login run there appear to be no workflow-level secret values, so the early return at the if not secret_values line bypasses redact_har_bytes() entirely — including the name-based redaction that would have caught both the password field and the cookies.

Suggested fix

Always call redact_har_bytes(data, secret_values) for ArtifactType.HAR (with an empty collection when there is nothing value-based to redact), so name-based header/cookie/form-field redaction still applies. The same reasoning may apply to BROWSER_CONSOLE_LOG, though that path is value-based only.

Impact

HAR artifacts of login runs are credential material: they contain valid session cookies and submitted passwords. Anyone shipping artifacts to object storage, an observability backend, or a support bundle would be shipping those too.

Happy to open a PR if the suggested direction looks right.