Add --format flag support to create-evidence#54
Conversation
ff09ef8 to
0df2f83
Compare
📗 Scan Summary
|
at 🎯 Static Application Security Testing (SAST) Vulnerability
Full descriptionVulnerability Details
OverviewStored Path Traversal is a type of vulnerability that arises when user-controlled Vulnerable examplefunc serveFile(w http.ResponseWriter, r *http.Request) {
row := db.QueryRow("SELECT file_path FROM files WHERE id = 12")
row.Scan(&filePath)
http.ServeFile(w, r, filePath)
}In this example, the RemediationTo mitigate stored path traversal vulnerabilities, it is essential to validate func serveFile(w http.ResponseWriter, r *http.Request) {
row := db.QueryRow("SELECT file_path FROM files WHERE id = ?", r.URL.Query().Get("id"))
row.Scan(&filePath)
+ // Validate file path to prevent directory traversal
+ if strings.Contains(filePath, "..") {
+ http.Error(w, "Invalid file path", http.StatusBadRequest)
+ return
+ }
http.ServeFile(w, r, filePath)
}Code FlowsVulnerable data flow analysis result
|
Replaces Contains-based assertions in printCreateEvidenceResponse JSON tests with full-payload JSONEq comparisons, per PR review feedback. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>


Pull Request Template
Description
Adds a
--formatflag (json|table) to thecreate-evidencecommand, so the result of an evidence creation can be rendered in a structured form on stdout. This bringscreate-evidencein line with the output-format pattern used by other JFrog CLI commands and makes it easier to consume the response programmatically (JSON) or read it interactively (table).When
--formatis omitted, the command's existing output is unchanged.Related Issue
https://jfrog-int.atlassian.net/browse/JGC-479
Testing
Unit tests cover the JSON and table renderers, including multi-response output and handling of an unsupported format.
Checklist