Skip to content

Capture release-bound browser readiness evidence - #131

Merged
cvsz merged 1 commit into
mainfrom
codex/release-bound-browser-evidence
Jul 19, 2026
Merged

Capture release-bound browser readiness evidence#131
cvsz merged 1 commit into
mainfrom
codex/release-bound-browser-evidence

Conversation

@cvsz

@cvsz cvsz commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • capture ZChat browser evidence with locked Playwright/Chromium on the deployed staging origin
  • require /health/live to report the exact immutable release SHA
  • sanitize HAR headers, cookies, query strings, request bodies, and response bodies before artifact upload
  • replace stale base64 browser secrets in Phase 6 and final readiness workflows with release-bound artifacts
  • pin newly introduced artifact actions and test workflow/security invariants

Verification

  • pnpm test
  • pnpm lint
  • pnpm typecheck
  • ECC pre-commit and pre-push checks

@ecc-tools

ecc-tools Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a script to capture and sanitize browser evidence from a deployed release using Playwright, along with corresponding tests and dependency updates. The review feedback identifies a security vulnerability where raw, unsanitized HAR files containing sensitive credentials are temporarily written to the shared /tmp directory. It is recommended to write these temporary files inside the securely configured outputDir instead to prevent unauthorized local access.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

"Cloudflare Access service-token credentials must be provided as a pair");

await mkdir(outputDir, { recursive: true, mode: 0o700 });
const rawHarPath = `/tmp/zchat-browser-${process.pid}.har`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

Security Vulnerability: Insecure Temporary File in Shared Directory (CWE-377 / CWE-276)

Writing the raw, unsanitized HAR file directly to /tmp poses a high security risk. On Unix-like systems, /tmp is a shared directory. Playwright's recordHar creates files with default permissions (subject to the system umask, typically 0o644 or 0o664), making them readable by any local user or process on the machine.

Since the raw HAR file contains highly sensitive credentials—such as the Cloudflare Access client secret (STAGING_CF_ACCESS_CLIENT_SECRET), session cookies, and authorization headers—before they are sanitized, any local attacker could read these secrets during the window of time the script is running.

Solution

Since outputDir is already created with secure 0o700 permissions (owner-only access) on line 88, we should write the temporary raw HAR file inside outputDir instead of /tmp. This ensures that the file is fully protected by the parent directory's restricted permissions and cannot be accessed by other users, completely mitigating the vulnerability.

Suggested change
const rawHarPath = `/tmp/zchat-browser-${process.pid}.har`;
const rawHarPath = outputDir + "/.raw-zchat-browser-" + process.pid + ".har";
References
  1. The repository style guide states that z-platform is a security-first platform. Writing sensitive raw credentials to a world-readable temporary file in /tmp violates this security-first design goal. (link)

@cvsz
cvsz merged commit f4b367f into main Jul 19, 2026
14 checks passed
@cvsz
cvsz deleted the codex/release-bound-browser-evidence branch July 19, 2026 01:04
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