-
Notifications
You must be signed in to change notification settings - Fork 2
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
#ab55467 #211
#ab55467 #211
Conversation
Signed-off-by: sbailey <[email protected]>
* fix(ci): Add KFC 11.x test labs * fix(store-types): Store type create omits empty fields. * fix(pam-types): `types-list` does not crash on nil httpResponse. * chore: Update license year, and bump AKV runner go version * fix(tests): Remove "ProviderTypeParams" from pam-types tests for KFC v11.0.0+ * fix(tests): Fix nil pointer issues on tests. * feat(stores): `stores export` now allows for `--all` and user interactive exports --------- Signed-off-by: sbailey <[email protected]> Co-authored-by: Keyfactor <[email protected]>
Release v1.4.0
Signed-off-by: sbailey <[email protected]>
Signed-off-by: sbailey <[email protected]>
Signed-off-by: sbailey <[email protected]>
Signed-off-by: sbailey <[email protected]>
Signed-off-by: sbailey <[email protected]>
…onfig file data. chore(deps): update `keyfactor-go-client` Signed-off-by: sbailey <[email protected]>
Signed-off-by: sbailey <[email protected]>
…SON string. Signed-off-by: sbailey <[email protected]>
Signed-off-by: sbailey <[email protected]>
Signed-off-by: sbailey <[email protected]>
} else { | ||
fmt.Println(fmt.Sprintf("%s", result)) | ||
if jerr != nil { | ||
output = fmt.Sprintf("{\"message\": \"%s\"}", result) |
Check failure
Code scanning / CodeQL
Potentially unsafe quoting Critical
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 months ago
To fix the problem, we need to ensure that any user-provided data embedded in a JSON string is properly escaped. The best way to fix this is to use a structured API for building JSON strings or to manually escape any quotes in the result
variable before embedding it in the JSON string.
In this case, we will use the strconv.Quote
function to properly escape the result
variable. This function will add double quotes around the string and escape any special characters, including double quotes, within the string.
-
Copy modified line R343
@@ -342,3 +342,3 @@ | ||
if jerr != nil { | ||
output = fmt.Sprintf("{\"message\": \"%s\"}", result) | ||
output = fmt.Sprintf("{\"message\": %s}", strconv.Quote(fmt.Sprintf("%s", result))) | ||
fmt.Println(output) |
jsonOutput, err := json.MarshalIndent(output, "", " ") | ||
if err != nil { | ||
//then output a { "message": "result" } json | ||
output = fmt.Sprintf("{\"message\": \"%s\"}", result) |
Check failure
Code scanning / CodeQL
Potentially unsafe quoting Critical
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
If this
JSON value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 months ago
To fix the problem, we need to ensure that any user-provided data embedded in a JSON string is properly escaped. The best way to achieve this is to use a structured API for building JSON objects or to manually escape special characters in the data.
In this case, we will use the strconv.Quote
function to properly escape the result
before embedding it in the JSON string. This function will handle escaping special characters and wrapping the string in double quotes.
-
Copy modified line R350
@@ -349,3 +349,3 @@ | ||
//then output a { "message": "result" } json | ||
output = fmt.Sprintf("{\"message\": \"%s\"}", result) | ||
output = fmt.Sprintf("{\"message\": %s}", strconv.Quote(fmt.Sprintf("%s", result))) | ||
fmt.Println(output) |
No description provided.