Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security issue: plugin-0g allows to upload any file #1753

Closed
vpavlin opened this issue Jan 3, 2025 · 3 comments
Closed

Security issue: plugin-0g allows to upload any file #1753

vpavlin opened this issue Jan 3, 2025 · 3 comments
Labels
bug Something isn't working SECURITY ISSUE

Comments

@vpavlin
Copy link
Contributor

vpavlin commented Jan 3, 2025

Describe the bug

Looking at 0g plugin, it seems it will allow anyone interacting with the agent to upload any file from the filesystem

https://github.com/elizaOS/eliza/blob/main/packages/plugin-0g/src/actions/upload.ts#L111

This is potentialyl very dangerous because the attacker could upload .env file, ssh keys or other secrets

To Reproduce

I have not tried to reproduce this, but it seems pretty obvious that an agent with 0g plugin enabled would not have an issue with uploading any filepath parsed by the template

Expected behavior

No private files are uploaded ever.

This could involve multiple approaches and risks should be highlighted to agent operator.

The template should check for potential security issues (assuming LLMs would generally understand where private files are stored)
image

More secure option would be to limit the filePath to some safe subdir, make it configurable in .env and then prefix or match the filePath with the prefix

Screenshots

Additional context

@vpavlin vpavlin added the bug Something isn't working label Jan 3, 2025
@vpavlin
Copy link
Contributor Author

vpavlin commented Jan 3, 2025

cc @lalalune

@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 4, 2025

I start working on this.

AIFlowML added a commit to AIFlowML/eliza_aiflow that referenced this issue Jan 4, 2025
… - Add FileSecurityValidator, file type restrictions, size limits, path traversal prevention, enhanced logging and security documentation (elizaOS#1753)
@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 6, 2025

Pushed already a fix for this with the PR #1806
I close this now and I will me monitoring the securoty of our code from now on.

@AIFlowML AIFlowML closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SECURITY ISSUE
Projects
None yet
Development

No branches or pull requests

3 participants