Commit 5829ca4
Merge commit from fork
The compilePipeline function passes the 'uses' value directly to
filepath.Join(pd, uses+".yaml") without validation. A crafted uses
value like "../../../etc/passwd" could read arbitrary files outside
the pipeline directory.
This fix rejects absolute paths and '..' sequences in uses, and
verifies the resolved path remains within the pipeline directory
using filepath.Rel after cleaning.
Co-authored-by: Mark <mark.manning@chainguard.dev>1 parent 9311e39 commit 5829ca4
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
228 | 233 | | |
229 | 234 | | |
230 | 235 | | |
231 | 236 | | |
232 | 237 | | |
233 | 238 | | |
234 | 239 | | |
235 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
236 | 246 | | |
237 | 247 | | |
238 | 248 | | |
| |||
0 commit comments