fix(deps): override vulnerable ansi-regex - #38
Merged
Conversation
Preserve current main's Modern Go, CI, security, and learned-rule updates while retaining the ansi-regex override and dependency-vulnerability prevention rule. Constraint: Keep the PR-specific diff relative to main limited to AGENTS.md and the two OpenClaw dependency files. Rejected: Rebase or force-push the shared PR branch. Confidence: The staged tree differs from origin/main in exactly three intended files and has no unmerged entries or diff-check errors. Scope-risk: The merge carries current main unchanged; conflict resolution appends one learned prevention rule. Tested: git diff --cached --check; exact three-file diff versus origin/main; merge-candidate frozen install, audit, typecheck, 16 tests under Node 24.15.0, build, and license check. Not-tested: Exact-head GitHub CI will run after push. Co-authored-by: OmX <omx@oh-my-codex.dev>
Replace the fixture's fixed native sleep with an explicit entry-and-release barrier so cancellation is guaranteed to happen before the synchronous open call returns. Constraint: Preserve the production SeekDB cancellation and cleanup behavior; change only the native test fixture and its learned prevention rule. Rejected: Retrying nanosleep after EINTR or increasing the delay because both remain timing-dependent and architecture-sensitive. Confidence: The exact linux-arm64 CI failure is explained by POSIX nanosleep interruption, while the barrier preserves the same public error and native-close assertions. Scope-risk: Test-only synchronization plus one AGENTS.md rule; no runtime code or dependency graph changes. Tested: WSL Go 1.27 targeted count 200; race targeted count 50; full seekdb package; license-eye 959 files with zero invalid; git diff checks. Not-tested: linux-arm64 exact-head CI will verify the affected architecture after push. Co-authored-by: OmX <omx@oh-my-codex.dev>
Derive the per-attempt cancellable context from t.Context so fatal paths remain bound to the test lifecycle before cleanup releases the native barrier. Constraint: Keep the explicit per-attempt cancel behavior and production Close call unchanged. Rejected: A background parent because it leaves an in-flight native call detached from test termination. Confidence: This follows the repository-resolved Go 1.27 testing_t_context guideline and preserves the same cancellation assertion. Scope-risk: One test-only context parent change. Tested: WSL targeted count 50; race targeted count 10; git diff check. Not-tested: Exact-head linux-arm64 CI will run after push. Co-authored-by: OmX <omx@oh-my-codex.dev>
8 tasks
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.
Summary
ansi-regexrequest in the OpenClaw memory plugin to the patched
5.0.1releaseansi-regex@5.0.0, andpreserve the Apache-2.0 header
in
AGENTS.mdan explicit entry/release barrier after exact-head linux-arm64 CI exposed the
sleep race; production SeekDB behavior is unchanged
Closes #11.
Security rationale
The vulnerable runtime path was:
openclaw -> qrcode -> yargs -> cliui@6.0.0 -> strip-ansi@6.0.0 -> ansi-regex@5.0.0GitHub Advisory
GHSA-93q8-gq69-wqmw/CVE-2021-3807marksansi-regex >=5.0.0,<5.0.1as vulnerable and5.0.1as the first patched5.x release. The root manifest override is compatible with the current graph
and avoids upgrading OpenClaw or unrelated transitive dependencies.
CI follow-up
The first refreshed exact-head run failed only in
Full build tags (linux-arm64). The failure came fromTestOpenClosesNativeInstanceWhenCancellationRepeatsDuringHandshake: its Cfixture wrote an entry marker and then called
nanosleeponce, assuming thecall would last 100 ms. POSIX permits
nanosleepto return early when a signalinterrupts it, so the native call could finish before the Go test issued
cancellation.
The fixture now blocks on an explicit release marker. The Go side observes
entry, cancels the context, and then releases the native call. This preserves
the same public
Openerror and native-close assertions without relying onscheduler timing or a longer timeout.
Behavior and compatibility
version change
vulnerable transitive edge to
ansi-regex@5.0.1Validation
Security and package checks:
main:pnpm audit --jsonreports one HIGH advisory onansi-regex@5.0.0pnpm why ansi-regexreports only
5.0.1, andpnpm audit --jsonreports zero vulnerabilitiesdistdifferencelicense-eye: 959 files checked, 0 invalidSeekDB cancellation checks:
internal/sqlstore/seekdbpackage passeswith
open error = <nil>, want context cancellationGitHub exact-head evidence for
b34d189bb8de8fa9cd7465e3ed66c8c39403c0f9:License Check
tags, race/fuzz/module integrity, both acceptance backends, coverage, and
all Linux/macOS standard/full matrices
CLEANandMERGEABLE; the GitHub merge-ref tree matchesthe reviewed Head tree
AI usage
Implemented and reviewed with Codex assistance. The advisory range, dependency
graph, Base/Head audit result, POSIX interruption behavior, deterministic test
mutation, final diff, comments, merge ref, and exact-head CI were verified
against current sources and reproducible commands.