Skip to content

Conversation

@orto17
Copy link
Contributor

@orto17 orto17 commented Dec 10, 2025

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.
  • Update documentation about new features / new supported technologies

@eyalk007 eyalk007 added the improvement Automatically generated release notes label Dec 11, 2025
Copy link
Contributor

@eranturgeman eranturgeman left a comment

Choose a reason for hiding this comment

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

See my comments, lets discuss on whatever needed

}

// After fixing the current vulnerability, checkout to the base branch to start fixing the next vulnerability
if e := cfp.gitManager.Checkout(cfp.scanDetails.BaseBranch()); e != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

you cannot remove this. we must return to the base branch between fixes so we will keep the worktree clean between fixes. This causes a lot of trouble in the past

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are always at the base branch, there are no different projects anymore that we are iterating

Copy link
Contributor

Choose a reason for hiding this comment

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

but remember that each fix is made in its own branch. then we need to create and checkout another branch for the next fix when fixing one by one.
Dont you think it will be safer to move to the base branch between fixes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i will test it for multiple fixed to understand the correct behavior

@eranturgeman eranturgeman added the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@eranturgeman eranturgeman added the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@eranturgeman eranturgeman added the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@eranturgeman eranturgeman added the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@eranturgeman eranturgeman added the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Dec 25, 2025
@github-actions
Copy link
Contributor

🚨 Frogbot scanned this pull request and found the below:

📗 Scan Summary

  • Frogbot scanned for vulnerabilities and found 8 issues
Scan Category Status Security Issues
Software Composition Analysis ✅ Done Not Found
Contextual Analysis ✅ Done -
Static Application Security Testing (SAST) ✅ Done
8 Issues Found 1 High
7 Medium
Secrets ✅ Done -
Infrastructure as Code (IaC) ✅ Done Not Found

@github-actions
Copy link
Contributor

body

at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go (line 246)

🎯 Static Application Security Testing (SAST) Vulnerability

Severity Finding
high
High
Deserializing untrusted data without validation
Full description

Vulnerability Details

Rule ID: go-unsafe-deserialization

Overview

Unsafe deserialization in Go occurs when a program deserializes untrusted
data with a potentially dangerous deserializer. Deserialization is the
process of converting serialized data (data that has been converted into a
format that can be easily transmitted or stored) back into its original
form. In some ("unsafe") serialization protocols, if an attacker is able
to manipulate the serialized data, they may be able to execute arbitrary
code or perform other malicious actions when the data is deserialized.

Vulnerable example

import (
    "github.com/go-yaml/yaml"
    "net/http"
)

func storeHandler(w http.ResponseWriter, r *http.Request) {
    var data map[string]interface{}
    yaml.Unmarshal([]byte(r.URL.Query().Get("data")), &data) // NOT OK
}

This code uses yaml.Unmarshal to deserialize untrusted data from the
user, with a potentially dangerous deserializer.

Remediation

import (
    "github.com/go-yaml/yaml"
    "net/http"
)

func storeHandler(w http.ResponseWriter, r *http.Request) {
    var data map[string]interface{}
    yaml.UnmarshalStrict([]byte(r.URL.Query().Get("data")), &data) // SAFE
}

Using yaml.UnmarshalStrict solves the problem by ensuring a safe
serialization protocol.

Code Flows
Vulnerable data flow analysis result

↘️ r.Body (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 239)

↘️ io.ReadAll(r.Body) (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 239)

↘️ body (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 239)

↘️ body (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 246)




@github-actions
Copy link
Contributor

content

at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go (line 192)

🎯 Static Application Security Testing (SAST) Vulnerability

Severity Finding
medium
Medium
Untrusted stored value is included in web page content
Full description

Vulnerability Details

Rule ID: go-stored-xss

Overview

Stored Cross-Site Scripting (XSS) is a type of vulnerability where malicious
scripts are injected into a web application and stored in a persistent state,
such as a database. When other users access the affected page, the stored
scripts are executed in their browsers, leading to various attacks.

Vulnerable example

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
    fmt.Fprintf(w, "<h1>%s</h1>", message)
}

In this example, the serveMessage function retrieves a message from the
database and directly embeds it into an HTML response without proper escaping.
If the message contains malicious scripts, it can lead to Stored XSS attacks
when other users view the page.

Remediation

To mitigate Stored XSS vulnerabilities, always sanitize and encode user
input before storing it in a persistent state and before displaying it
to other users:

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
-   fmt.Fprintf(w, "<h1>%s</h1>", message)
+   fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}

In the remediation, we've used the html.EscapeString function to escape
the message before embedding it into the HTML response. This helps prevent
the execution of malicious scripts and mitigates the Stored XSS vulnerability.

Code Flows
Vulnerable data flow analysis result

↘️ os.ReadFile("../testdata/configprofile/configProfileExample.json") (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 172)

↘️ content (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 172)

↘️ content (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 192)




@github-actions
Copy link
Contributor

content

at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go (line 201)

🎯 Static Application Security Testing (SAST) Vulnerability

Severity Finding
medium
Medium
Untrusted stored value is included in web page content
Full description

Vulnerability Details

Rule ID: go-stored-xss

Overview

Stored Cross-Site Scripting (XSS) is a type of vulnerability where malicious
scripts are injected into a web application and stored in a persistent state,
such as a database. When other users access the affected page, the stored
scripts are executed in their browsers, leading to various attacks.

Vulnerable example

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
    fmt.Fprintf(w, "<h1>%s</h1>", message)
}

In this example, the serveMessage function retrieves a message from the
database and directly embeds it into an HTML response without proper escaping.
If the message contains malicious scripts, it can lead to Stored XSS attacks
when other users view the page.

Remediation

To mitigate Stored XSS vulnerabilities, always sanitize and encode user
input before storing it in a persistent state and before displaying it
to other users:

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
-   fmt.Fprintf(w, "<h1>%s</h1>", message)
+   fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}

In the remediation, we've used the html.EscapeString function to escape
the message before embedding it into the HTML response. This helps prevent
the execution of malicious scripts and mitigates the Stored XSS vulnerability.

Code Flows
Vulnerable data flow analysis result

↘️ os.ReadFile("../testdata/configprofile/configProfileExample.json") (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 198)

↘️ content (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 198)

↘️ content (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/utils/testsutils.go line 201)




@github-actions
Copy link
Contributor

file

at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanrepository/scanrepository_test.go (line 768)

🎯 Static Application Security Testing (SAST) Vulnerability

Severity Finding
medium
Medium
Untrusted stored value is included in web page content
Full description

Vulnerability Details

Rule ID: go-stored-xss

Overview

Stored Cross-Site Scripting (XSS) is a type of vulnerability where malicious
scripts are injected into a web application and stored in a persistent state,
such as a database. When other users access the affected page, the stored
scripts are executed in their browsers, leading to various attacks.

Vulnerable example

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
    fmt.Fprintf(w, "<h1>%s</h1>", message)
}

In this example, the serveMessage function retrieves a message from the
database and directly embeds it into an HTML response without proper escaping.
If the message contains malicious scripts, it can lead to Stored XSS attacks
when other users view the page.

Remediation

To mitigate Stored XSS vulnerabilities, always sanitize and encode user
input before storing it in a persistent state and before displaying it
to other users:

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
-   fmt.Fprintf(w, "<h1>%s</h1>", message)
+   fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}

In the remediation, we've used the html.EscapeString function to escape
the message before embedding it into the HTML response. This helps prevent
the execution of malicious scripts and mitigates the Stored XSS vulnerability.

Code Flows
Vulnerable data flow analysis result

↘️ os.ReadFile(fmt.Sprintf("%s.tar.gz", projectName)) (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanrepository/scanrepository_test.go line 766)

↘️ file (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanrepository/scanrepository_test.go line 766)

↘️ file (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanrepository/scanrepository_test.go line 768)




@github-actions
Copy link
Contributor

repoFile

at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go (line 985)

🎯 Static Application Security Testing (SAST) Vulnerability

Severity Finding
medium
Medium
Untrusted stored value is included in web page content
Full description

Vulnerability Details

Rule ID: go-stored-xss

Overview

Stored Cross-Site Scripting (XSS) is a type of vulnerability where malicious
scripts are injected into a web application and stored in a persistent state,
such as a database. When other users access the affected page, the stored
scripts are executed in their browsers, leading to various attacks.

Vulnerable example

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
    fmt.Fprintf(w, "<h1>%s</h1>", message)
}

In this example, the serveMessage function retrieves a message from the
database and directly embeds it into an HTML response without proper escaping.
If the message contains malicious scripts, it can lead to Stored XSS attacks
when other users view the page.

Remediation

To mitigate Stored XSS vulnerabilities, always sanitize and encode user
input before storing it in a persistent state and before displaying it
to other users:

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
-   fmt.Fprintf(w, "<h1>%s</h1>", message)
+   fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}

In the remediation, we've used the html.EscapeString function to escape
the message before embedding it into the HTML response. This helps prevent
the execution of malicious scripts and mitigates the Stored XSS vulnerability.

Code Flows
Vulnerable data flow analysis result

↘️ os.ReadFile(filepath.Join("..", params.RepoName, "targetBranch.gz")) (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 983)

↘️ repoFile (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 983)

↘️ repoFile (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 985)




@github-actions
Copy link
Contributor

comments

at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go (line 992)

🎯 Static Application Security Testing (SAST) Vulnerability

Severity Finding
medium
Medium
Untrusted stored value is included in web page content
Full description

Vulnerability Details

Rule ID: go-stored-xss

Overview

Stored Cross-Site Scripting (XSS) is a type of vulnerability where malicious
scripts are injected into a web application and stored in a persistent state,
such as a database. When other users access the affected page, the stored
scripts are executed in their browsers, leading to various attacks.

Vulnerable example

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
    fmt.Fprintf(w, "<h1>%s</h1>", message)
}

In this example, the serveMessage function retrieves a message from the
database and directly embeds it into an HTML response without proper escaping.
If the message contains malicious scripts, it can lead to Stored XSS attacks
when other users view the page.

Remediation

To mitigate Stored XSS vulnerabilities, always sanitize and encode user
input before storing it in a persistent state and before displaying it
to other users:

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
-   fmt.Fprintf(w, "<h1>%s</h1>", message)
+   fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}

In the remediation, we've used the html.EscapeString function to escape
the message before embedding it into the HTML response. This helps prevent
the execution of malicious scripts and mitigates the Stored XSS vulnerability.

Code Flows
Vulnerable data flow analysis result

↘️ os.ReadFile(filepath.Join("..", "commits.json")) (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 990)

↘️ comments (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 990)

↘️ comments (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 992)




@github-actions
Copy link
Contributor

discussions

at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go (line 1027)

🎯 Static Application Security Testing (SAST) Vulnerability

Severity Finding
medium
Medium
Untrusted stored value is included in web page content
Full description

Vulnerability Details

Rule ID: go-stored-xss

Overview

Stored Cross-Site Scripting (XSS) is a type of vulnerability where malicious
scripts are injected into a web application and stored in a persistent state,
such as a database. When other users access the affected page, the stored
scripts are executed in their browsers, leading to various attacks.

Vulnerable example

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
    fmt.Fprintf(w, "<h1>%s</h1>", message)
}

In this example, the serveMessage function retrieves a message from the
database and directly embeds it into an HTML response without proper escaping.
If the message contains malicious scripts, it can lead to Stored XSS attacks
when other users view the page.

Remediation

To mitigate Stored XSS vulnerabilities, always sanitize and encode user
input before storing it in a persistent state and before displaying it
to other users:

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
-   fmt.Fprintf(w, "<h1>%s</h1>", message)
+   fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}

In the remediation, we've used the html.EscapeString function to escape
the message before embedding it into the HTML response. This helps prevent
the execution of malicious scripts and mitigates the Stored XSS vulnerability.

Code Flows
Vulnerable data flow analysis result

↘️ os.ReadFile(filepath.Join("..", "list_merge_request_discussion_items.json")) (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 1025)

↘️ discussions (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 1025)

↘️ discussions (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 1027)




@github-actions
Copy link
Contributor

repoFile

at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go (line 978)

🎯 Static Application Security Testing (SAST) Vulnerability

Severity Finding
medium
Medium
Untrusted stored value is included in web page content
Full description

Vulnerability Details

Rule ID: go-stored-xss

Overview

Stored Cross-Site Scripting (XSS) is a type of vulnerability where malicious
scripts are injected into a web application and stored in a persistent state,
such as a database. When other users access the affected page, the stored
scripts are executed in their browsers, leading to various attacks.

Vulnerable example

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
    fmt.Fprintf(w, "<h1>%s</h1>", message)
}

In this example, the serveMessage function retrieves a message from the
database and directly embeds it into an HTML response without proper escaping.
If the message contains malicious scripts, it can lead to Stored XSS attacks
when other users view the page.

Remediation

To mitigate Stored XSS vulnerabilities, always sanitize and encode user
input before storing it in a persistent state and before displaying it
to other users:

func serveMessage(w http.ResponseWriter, r *http.Request) {
    db, _ := sql.Open("sqlite3", "test.db")
    message := db.QueryRow("SELECT message FROM messages WHERE id = 1")
-   fmt.Fprintf(w, "<h1>%s</h1>", message)
+   fmt.Fprintf(w, "<h1>%s</h1>", html.EscapeString(message))
}

In the remediation, we've used the html.EscapeString function to escape
the message before embedding it into the HTML response. This helps prevent
the execution of malicious scripts and mitigates the Stored XSS vulnerability.

Code Flows
Vulnerable data flow analysis result

↘️ os.ReadFile(filepath.Join("..", params.RepoName, "sourceBranch.gz")) (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 976)

↘️ repoFile (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 976)

↘️ repoFile (at file:///C:/Users/runneradmin/AppData/Local/Temp/jfrog.cli.temp.-1766674312-3032194202/scanpullrequest/scanpullrequest_test.go line 978)




@eranturgeman eranturgeman merged commit a2807ce into jfrog:v3_er Dec 25, 2025
18 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants