CycodeLabs / CycodeLabs/cimon-action

downloadToFile caches HTTP error responses. AccessDenied XML saved as install.sh on persistent runners

Open
#119 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
124
Forks
10
Avg merge
20h 50m
Merged PRs (30d)
1

Description

On persistent self-hosted runners, the `/tmp/` directory is persistent between runs. Coupled with an error that was returned on the first execution, `cimon-action` subsequently fails all further runs for two reasons:

First, `downloadToFile` does not check the HTTP response status code before writing to disk. If the S3 URL returns a non-200 response (e.g. 403 AccessDenied), the error body is written verbatim to `/tmp/install.sh`.

Second, The cache guard checks only for file existence, not file integrity. On subsequent runs, `existsSync('/tmp/install.sh')` returns true for the corrupt file and the re-download is permanently skipped.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.