We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdfa978 commit b04bda5Copy full SHA for b04bda5
action.yml
@@ -172,6 +172,15 @@ runs:
172
run: |
173
SOURCE_PATH="$INPUT_INPUTS_PATH"
174
[[ "$SOURCE_PATH" != /* ]] && SOURCE_PATH="${WORKSPACE}/$SOURCE_PATH"
175
+
176
+ # Prevent path traversal outside the workspace
177
+ REAL_SOURCE=$(realpath -m "$SOURCE_PATH")
178
+ REAL_WORKSPACE=$(realpath "$WORKSPACE")
179
+ if [[ "$REAL_SOURCE" != "$REAL_WORKSPACE"* ]]; then
180
+ echo "::error::inputs-path resolves outside the workspace. Aborting."
181
+ exit 1
182
+ fi
183
184
DESTINATION_PATH="${PROJECT_WORK_DIRECTORY}/input/"
185
mkdir -p "$DESTINATION_PATH"
186
0 commit comments