The vulnerability, identified as GHSA-fv2r-r8mp-pg48, stems from the lack of sanitization of user-provided input for ANSI escape sequences across multiple components of the Soft Serve application. An attacker could inject these sequences into various fields such as repository descriptions, project names, usernames, and git commit details. When the application later displays this data in a terminal, the embedded ANSI sequences are rendered, allowing the attacker to manipulate the terminal's output. This could be used to mislead users by displaying fake alerts, hiding legitimate information, or otherwise interfering with the user interface.
The patch addresses this issue by introducing a utils.Sanitize function that strips ANSI escape codes from strings. This function is then applied to user input in all the identified vulnerable locations before the data is stored or displayed. The analysis of the patch commit d9639320b8d0ccd76fe6836a042c042b0ebde549 confirms these changes across several files, including pkg/backend/repo.go, pkg/backend/access_token.go, and pkg/ssh/cmd/commit.go. The identified vulnerable functions are the points of entry where this unsanitized data was being processed.