[GH-ISSUE #3821] Wrong storage directory for Orion model [bug might hide a dangerous arbitrary file overwriting problem] #48875

Closed
opened 2026-04-28 09:56:49 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @liar666 on GitHub (Apr 22, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3821

What is the issue?

Hi,

I've written a script to export/backup ollama's model (see https://github.com/ollama/ollama/issues/335#issuecomment-1968768357)

When I tried to backup orion14b-q4, I discovered a strange thing: it is stored in /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/**orionstar/orion14b-q4/**latest instead of /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/**library/<model>/**latest

I assume this is due to the fact that the name of the model itself is "badly" formed (it contains a '/'):

zephyr:latest               	bbe38b81adec	4.1 GB	7 weeks ago   	
orionstar/orion14b-q4:latest	9297ec2a4101	8.8 GB	17 minutes ago	

and some parsing script has mistook the '/' in the name for a directory separator.

Someone could probably abuse this parsing bug and overwrite any file that ollama user/group is allowed to change.

My advice would be to strip model names from non letters/digits characters.

OS

Linux

GPU

No response

CPU

No response

Ollama version

0.1.27

Originally created by @liar666 on GitHub (Apr 22, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3821 ### What is the issue? Hi, I've written a script to export/backup ollama's model (see https://github.com/ollama/ollama/issues/335#issuecomment-1968768357) When I tried to backup orion14b-q4, I discovered a strange thing: it is stored in `/usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/**orionstar/orion14b-q4/**latest` instead of `/usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/**library/<model>/**latest` I assume this is due to the fact that the name of the model itself is "badly" formed (it contains a '/'): ``` zephyr:latest bbe38b81adec 4.1 GB 7 weeks ago orionstar/orion14b-q4:latest 9297ec2a4101 8.8 GB 17 minutes ago ``` and some parsing script has mistook the '/' in the name for a directory separator. Someone could probably abuse this parsing bug and overwrite any file that `ollama` user/group is allowed to change. My advice would be to strip model names from non letters/digits characters. ### OS Linux ### GPU _No response_ ### CPU _No response_ ### Ollama version 0.1.27
GiteaMirror added the bug label 2026-04-28 09:56:49 -05:00
Author
Owner

@pdevine commented on GitHub (Apr 22, 2024):

This is the correct behaviour. The models in library/ are ones published by the Ollama team, whereas the orion 14b model you pulled was from the orionstar team. You can also create your own account on ollama.com and push your own models to the Ollama registry

I'll go ahead and close the issue.

<!-- gh-comment-id:2070607282 --> @pdevine commented on GitHub (Apr 22, 2024): This is the correct behaviour. The models in `library/` are ones published by the Ollama team, whereas the orion 14b model you pulled was from the `orionstar` team. You can also create your own account on ollama.com and push your own models to the Ollama registry I'll go ahead and close the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#48875