Skip to content

Conversation

@finettt
Copy link

@finettt finettt commented Oct 15, 2025

Replace OpenRouter integration with OpenAI-like API support, implement robust shell command sanitization, and introduce Napoleon Dynamite personality module. Add multi-step command chaining capabilities and update build configuration for new dependencies.

…on validation

- Add command sanitization to prevent shell injection attacks
- Replace system() with popen() for safer command execution
- Add validation for dangerous characters and shell constructs
- Enhance configuration system with environment variable validation
- Add proper error handling and buffer size checks
- Improve JSON escaping to prevent injection attacks

BREAKING CHANGE: Environment variable names changed from OR_KEY to OPENAI_KEY, and OPENAI_BASE and OPENAI_MODEL are now required
Replace OpenRouter integration with OpenAI API support, implement robust shell command sanitization, and introduce Napoleon Dynamite personality module. Add multi-step command chaining capabilities and update build configuration for new dependencies.
cursor[bot]

This comment was marked as outdated.

finettt and others added 3 commits October 20, 2025 16:07
- Add GitHub Actions CI matrix build with basic tests
- Add release workflow to build, checksum, and upload assets
- Implement RAG via grep-based local context search
- Add CLI args: --rag PATH and --rag-snippets N; env vars RAG_*
- Integrate RAG snippets into user prompt when enabled
- Add args.c and rag.c; extend Config with RAG fields
- Move sources to src/ and update Makefile SOURCES
- Escape control characters in JSON content
- Secure temp files with 0600 and switch to exit()
- Update README and relocate preview to docs/
… and RAG support

- Add GitHub Actions CI matrix build with basic tests
- Add release workflow to build, checksum, and upload assets
- Implement RAG via grep-based local context search
- Add CLI args: --rag PATH and --rag-snippets N; env vars RAG_*
- Integrate RAG snippets into user prompt when enabled
- Add args.c and rag.c; extend Config with RAG fields
- Move sources to src/ and update Makefile SOURCES
- Escape control characters in JSON content
- Secure temp files with 0600 and switch to exit()
- Update README and relocate preview to docs/
cursor[bot]

This comment was marked as outdated.

- Validate and sanitize path to prevent injection/traversal
- Resolve paths with realpath and ensure they stay within CWD
- Use resolved path in grep command
- Add Windows realpath/getcwd shims and required headers
cursor[bot]

This comment was marked as outdated.

- Update Makefile to improve build flags and streamline Windows build process.
- Implement platform-specific clean and install commands for better user experience.
- Enhance command execution in agent.c with stricter sanitization and error handling.
- Remove deprecated GitHub Actions CI workflow file.
- Update README to reflect changes in API base URL and installation instructions.
messages[sizeof(messages) - 1] = '\0';
} else {
strcat(messages, "]");
}
Copy link

Choose a reason for hiding this comment

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

Bug: JSON Request Fails When Buffer Overflows

The json_request function generates malformed JSON when the messages buffer is full. If strlen(messages) + 1 >= sizeof(messages), the closing ] bracket is omitted, causing API requests to fail.

Fix in Cursor Fix in Web

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