-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
WorkflowEventBinding Parameter from json doesn't work with % symbol #7042
Labels
Comments
This smells of injection vulnerability. |
The fix for this, I think, is this: func (i Item) Format(s fmt.State, _ rune) {
_, _ = fmt.Fprintf(s, "%s", i.String()) //nolint
} @jrobertson-insite you seem to have a good handle on the code and tests? Would you like to submit a PR? |
Sure. I'll have a deeper look and submit a PR. |
jrobertson-insite
added a commit
to jrobertson-insite/argo-workflows
that referenced
this issue
Oct 28, 2021
…7042 Signed-off-by: Jonathan Robertson <jrobertson@insitesoft.com>
sarabala1979
pushed a commit
that referenced
this issue
Dec 15, 2021
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
In a WorkflowEventBinding Parameter, the value is passed through Go's fmt library more than once. This causes all of Go's fmt specifiers to be applied to the user specified input.
In my case when the parameter has a value of
payload.sqlQuery
, andpayload.sqlQuery
has a value ofSELECT * FROM test WHERE Name LIKE '%MyName%'
we see this value in the actual workflow submitted asSELECT * FROM test WHERE Name LIKE '%!M(MISSING)yName%!(NOVERB)'
.I'm unsure if this is intended or not. If you submit the same workflow through the UI with the same values you send in via json it gives the value without going through fmt twice and trying to parse the percent modifiers.
Example
WorkflowEventBinding Parameter Input (via json):
%MyName%
Submitted Workflow Parameter Input (from WorkflowEventBinding)
The real world use case for this is passing an sql query into a workflow event binding. Where we use the % symbol in the LIKE clause. To work around we're just manually encoding the percent symbol on the sender's side.
What version of Argo Workflows are you running?
v3.2.2
Diagnostics
See test cases on my fork
Or this can be used to reproduce locally.
JSON payload for event submitted to argo workflows
What executor are you running? Docker/K8SAPI/Kubelet/PNS/Emissary
Emissary
Logs from the workflow controller:
No relevant logs. Workflow is submitted with myQuery variable as
SELECT * FROM test WHERE Name LIKE '%!M(MISSING)yName%!(NOVERB)'
rather than what I expect
SELECT * FROM test WHERE Name LIKE '%MyName%'
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.
The text was updated successfully, but these errors were encountered: