Skip to content

Improve JSON validation in start-proxy action #2956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mbg
Copy link
Member

@mbg mbg commented Jun 27, 2025

This PR makes three changes related to the start-proxy action:

  1. Additional validation is performed on the structure of the parsed JSON, to ensure that we have an array of configurations, configurations themselves are objects, and we don't accidentally treat null values as meaningful.
  2. The backend may give us a configuration where the password is actually a token, which can lead to confusion when inspecting the logs and seeing that token is undefined even when it is expected to be defined. We believe that username is always undefined in that case, so we can use that as an indicator to treat the password as the token instead.
  3. The test coverage is extended for these changes.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Comment on lines +58 to +63
startProxyExports.getCredentials(
getRunnerLogger(true),
undefined,
testCredential,
undefined,
),

Check failure

Code scanning / CodeQL

Untrusted data passed to external API with additional heuristic sources High Experimental

Call to ava.[callback].[param 't'].throws() [callback 0 result] with untrusted data from
getToke ... word(e)
.
Comment on lines +81 to +86
startProxyExports.getCredentials(
getRunnerLogger(true),
undefined,
testCredential,
undefined,
),

Check failure

Code scanning / CodeQL

Untrusted data passed to external API with additional heuristic sources High Experimental

Call to ava.[callback].[param 't'].throws() [callback 0 result] with untrusted data from
getToke ... word(e)
.
undefined,
);
for (const credential of credentials) {
t.not(credential.token, undefined);

Check failure

Code scanning / CodeQL

Untrusted data passed to external API with additional heuristic sources High Experimental

Call to ava.[callback].[param 't'].not() [param 0] with untrusted data from
getToke ... word(e)
.
);
for (const credential of credentials) {
t.not(credential.token, undefined);
t.is(credential.password, undefined);

Check failure

Code scanning / CodeQL

Untrusted data passed to external API with additional heuristic sources High Experimental

Call to ava.[callback].[param 't'].is() [param 0] with untrusted data from
getToke ... word(e)
.
Call to ava.[callback].[param 't'].is() [param 0] with untrusted data from
credential.password
.
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.

1 participant