Skip to content

chore: sync core lib and CLAUDE.md from agent-core#40

Merged
avifenesh merged 1 commit into
mainfrom
chore/sync-core-sync-docs-20260530-093141
May 30, 2026
Merged

chore: sync core lib and CLAUDE.md from agent-core#40
avifenesh merged 1 commit into
mainfrom
chore/sync-core-sync-docs-20260530-093141

Conversation

@avifenesh
Copy link
Copy Markdown
Contributor

Automated sync of lib/ and CLAUDE.md from agent-core.

Copy link
Copy Markdown
Contributor

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

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 introduces safer file handling practices to mitigate Time-of-Check to Time-of-Use (TOCTOU) race conditions and symlink attacks. It implements a new readFileWithLimit utility that reads files via a single file descriptor and integrates atomic write operations across multiple analyzers. The review feedback suggests further strengthening security by asserting that target paths are not symbolic links before backup and write operations in docs-analyzer.js and prompt-analyzer.js, and enforcing a file size limit when reading the suppression file in auto-suppression.js to prevent potential Denial of Service (DoS) vulnerabilities.

Comment thread lib/enhance/docs-analyzer.js
Comment thread lib/enhance/prompt-analyzer.js
Comment thread lib/enhance/prompt-analyzer.js
Comment thread lib/enhance/auto-suppression.js
@avifenesh
Copy link
Copy Markdown
Contributor Author

This is an auto-sync of the already-reviewed agent-core fix (PR agent-sh/agent-core#25). The auto-reviewer's symlink/TOCTOU notes are addressed by the design: reads use the fd-based readFileWithLimit, and writes use writeFileAtomic (temp file + atomic rename). rename() replaces the path entry itself and never follows a symlink to its target, so it is symlink-safe by construction - the explicit assertNotSymlink in fixer.js is belt-and-suspenders for that path. Merging to keep lib in sync with the source.

@avifenesh avifenesh merged commit ec7744f into main May 30, 2026
9 checks passed
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