Azure / Azure/run-command-handler-linux
Script filename from SasUri cannot contain /
- Dominant language
- Go
- Stars
- 2
- Forks
- 16
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 2
Description
I have a script source SasUri like:
```
https://xxx.blob.windows.net/container/foo/bar.sh
```
According to:
https://github.com/Azure/run-command-handler-linux/blob/6efb77e0fec9b1ff87c980d1a207f0fc73493b8a/pkg/download/blob.go#L82-L99
`fileName` becomes `foo/bar.sh`. However, directory `foo` doesn't exist so the `open` below always fails.
Suggest using fixed file name like a GUID. Otherwise you have to deal with `..` and `/` in paths which could cause a lot of security troubles.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in pkg/download/blob.go at the filename extraction and file opening code referenced in the issue. Trace how the SasUri path becomes fileName, then verify handling for foo/bar.sh and paths containing .. or /. Done means a script URI with nested path components can be processed without the missing-directory failure or unsafe path behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100