Skip to content

Conversation

@lukeina2z
Copy link
Contributor

Mitigate remote code execution in release-build.yml where unsanitized user input could execute arbitrary commands and expose secrets.

  • Add input validation for semantic versioning format
  • Use environment variables instead of direct interpolation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Mitigate remote code execution in release-build.yml where unsanitized user input could execute arbitrary commands and expose secrets.

- Add input validation for semantic versioning format
- Use environment variables instead of direct interpolation
@lukeina2z lukeina2z requested a review from a team as a code owner November 7, 2025 19:42
fi
- name: Build and test
run: ./gradlew build -Prelease.version=${{ github.event.inputs.version }} --stacktrace
run: ./gradlew build -Prelease.version="${RELEASE_VERSION}" --stacktrace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sanity check: should this not be "$RELEASE_VERSION" - similar to https://github.com/aws-observability/aws-otel-go/pull/280/files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please elaborate? "$RELEASE_VERSION" is an intermediate environment variable, similar to "$TARGET_SHA" in your PR. Why shouldn't it be used?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are doing "${RELEASE_VERSION}", does that work the same as "$RELEASE_VERSION"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No functional difference here, but "${RELEASE_VERSION}" is cleaner and safer in general.

3.5.3 Shell Parameter Expansion
https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion-1

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, we should keep the style consistent with our other repos. It looks we don't use braces for retrieving env var in other workflows, and I vote for the no-brace style - $RELEASE_VERSION here.

https://github.com/search?q=repo%3Aaws-observability%2Faws-otel-python-instrumentation+%22%24+language%3AYAML&type=code&l=YAML

Copy link
Contributor

@thpierce thpierce Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a minor point and reversible, just wanted to make sure it was functionally equivalent. Approved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brace is removed now.

@thpierce thpierce self-requested a review November 7, 2025 19:48
@lukeina2z lukeina2z merged commit 5d0a0d2 into aws:master Nov 10, 2025
11 of 12 checks passed
@lukeina2z lukeina2z deleted the pr-sec-foo branch November 10, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants