Skip to content

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

Merged
avifenesh merged 1 commit into
mainfrom
chore/sync-core-audit-project-20260426-152014
Apr 26, 2026
Merged

chore: sync core lib and CLAUDE.md from agent-core#26
avifenesh merged 1 commit into
mainfrom
chore/sync-core-audit-project-20260426-152014

Conversation

@avifenesh
Copy link
Copy Markdown
Contributor

@avifenesh avifenesh commented Apr 26, 2026

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


Note

Medium Risk
Adds symlink checks around file read/write/backup/restore paths, which changes fixer behavior and may cause previously-fixable repos using symlinks to error out, but reduces risk of unintended writes to sensitive targets.

Overview
Hardens lib/enhance/fixer.js against symlink attacks by adding assertNotSymlink() and invoking it before reading, before writing, and when creating/restoring .backup files.

Auto-fix and restoreFromBackup now refuse to operate on symlinked targets (or pre-existing symlinked backup paths) and surface a specific error instead of following the link.

Reviewed by Cursor Bugbot for commit f233790. Configure here.

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@avifenesh avifenesh merged commit dc4e3bc into main Apr 26, 2026
5 checks passed
@avifenesh avifenesh deleted the chore/sync-core-audit-project-20260426-152014 branch April 26, 2026 15:24
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f233790. Configure here.

Comment thread lib/enhance/fixer.js
if (backup) {
const backupPath = `${filePath}.backup`;
// Refuse if the backup slot itself is a pre-existing symlink.
assertNotSymlink(backupPath);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Backup symlink error misattributed to main file path

Low Severity

When assertNotSymlink(backupPath) throws ESYMLINK_REFUSED, it falls through to the outer catch which records the error against filePath — not the actual backupPath that has the symlink. This misattributes the problem, making it hard for users to diagnose. Additionally, unlike the filePath symlink check (which has its own try/catch, continue, and structured error with success/reason fields), this path silently prevents the fix from being written to the perfectly valid filePath and loses the computed appliedToFile entries (they appear in neither results.applied nor results.skipped).

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f233790. Configure here.

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