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

[fix] Fix CVE-2024-6227 #3197

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

### Fixes
- Fix bug in bookmark page where it was not scrollable if there was too many bookmarks (vinayan3)

- Fix [CVE-2024-622](https://huntr.com/bounties/abcea7c6-bb3b-45e9-aa15-9eb6b224451a)
## 3.23.0 Jul 15, 2024

### Enhancements:
Expand Down
2 changes: 2 additions & 0 deletions aim/cli/server/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
AIM_SERVER_DEFAULT_HOST,
AIM_SERVER_DEFAULT_PORT,
AIM_SERVER_MOUNTED_REPO_PATH,
AIM_SERVER_MOUNT,
)
from aim.sdk.repo import Repo
from aim.sdk.utils import clean_repo_path
Expand Down Expand Up @@ -79,6 +80,7 @@ def server(host, port, repo, ssl_keyfile, ssl_certfile, base_path, log_level, de
return

os.environ[AIM_SERVER_MOUNTED_REPO_PATH] = repo_inst.path
os.environ[AIM_SERVER_MOUNT] = f"aim://{host}:{port}"

click.secho('Running Aim Server on repo `{}`'.format(repo), fg='yellow')
click.echo('Server is mounted on aim://{}:{}'.format(host, port), err=True)
Expand Down
1 change: 1 addition & 0 deletions aim/ext/transport/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
AIM_SERVER_DEFAULT_HOST = '0.0.0.0'
AIM_SERVER_MOUNTED_REPO_PATH = '__AIM_SERVER_MOUNT_REPO_PATH__'
AIM_SERVER_BASE_PATH = '__AIM_SERVER_BASE_PATH__'
AIM_SERVER_MOUNT = '__AIM_SERVER_MOUNT'

AIM_RT_BEARER_TOKEN = '__AIM_RT_BEARER_TOKEN__'
3 changes: 3 additions & 0 deletions aim/sdk/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from aim.ext.sshfs.utils import mount_remote_repo, unmount_remote_repo
from aim.ext.task_queue.queue import TaskQueue
from aim.ext.transport.client import Client
from aim.ext.transport.config import AIM_SERVER_MOUNT
from aim.sdk.configs import AIM_ENABLE_TRACKING_THREAD, get_aim_repo_name
from aim.sdk.data_version import DATA_VERSION
from aim.sdk.errors import RepoIntegrityError
Expand Down Expand Up @@ -205,6 +206,8 @@ def from_path(cls, path: str, read_only: bool = None, init: bool = False):
Returns:
:obj:`Repo` object.
"""
if os.environ.get(AIM_SERVER_MOUNT, '') == path:
raise ValueError("The path cannot be the same as the mount of the server.")
if not path.startswith('ssh://') and not cls.is_remote_path(path):
path = clean_repo_path(path)
repo = cls._pool.get(path)
Expand Down