Skip to content

Go: Reinstate imprecise strings.Join model - #22645

Draft
owen-mc wants to merge 5 commits into
github:mainfrom
owen-mc:go/mad/strings-join
Draft

owen-mc wants to merge 5 commits into
github:mainfrom
owen-mc:go/mad/strings-join

Conversation

@owen-mc

@owen-mc owen-mc commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Preserve flow when Argument[0] is tainted as a whole but its array-element access path is unavailable.

Example code where this is needed:

		for k, v := range request.Header {
			sink(strings.Join(v, ","))
		}

Currently our Go library does not have the functionality to give request.Header an access path (like MapValue.ArrayElement) when marking it as a source. Hence v ends up tainted without the correct access path of ArrayElement.

Preserve flow when Argument[0] is tainted as a whole but its array-element access path is unavailable.
@owen-mc
owen-mc requested a review from a team as a code owner September 22, 2026 10:48
Copilot AI balanced review requested due to automatic review settings September 22, 2026 10:48
@owen-mc owen-mc added the no-change-note-required This PR does not need a change note label Sep 22, 2026
@github-actions

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

go

Generated file changes for go

  • Changes to framework-coverage-go.rst:
-    `Standard library <https://pkg.go.dev/std>`_,"````, ``archive/*``, ``bufio``, ``bytes``, ``cmp``, ``compress/*``, ``container/*``, ``context``, ``crypto``, ``crypto/*``, ``database/*``, ``debug/*``, ``embed``, ``encoding``, ``encoding/*``, ``errors``, ``expvar``, ``flag``, ``fmt``, ``go/*``, ``hash``, ``hash/*``, ``html``, ``html/*``, ``image``, ``image/*``, ``index/*``, ``io``, ``io/*``, ``log``, ``log/*``, ``maps``, ``math``, ``math/*``, ``mime``, ``mime/*``, ``net``, ``net/*``, ``os``, ``os/*``, ``path``, ``path/*``, ``plugin``, ``reflect``, ``reflect/*``, ``regexp``, ``regexp/*``, ``slices``, ``sort``, ``strconv``, ``strings``, ``sync``, ``sync/*``, ``syscall``, ``syscall/*``, ``testing``, ``testing/*``, ``text/*``, ``time``, ``time/*``, ``unicode``, ``unicode/*``, ``unsafe``, ``weak``",52,674,127
+    `Standard library <https://pkg.go.dev/std>`_,"````, ``archive/*``, ``bufio``, ``bytes``, ``cmp``, ``compress/*``, ``container/*``, ``context``, ``crypto``, ``crypto/*``, ``database/*``, ``debug/*``, ``embed``, ``encoding``, ``encoding/*``, ``errors``, ``expvar``, ``flag``, ``fmt``, ``go/*``, ``hash``, ``hash/*``, ``html``, ``html/*``, ``image``, ``image/*``, ``index/*``, ``io``, ``io/*``, ``log``, ``log/*``, ``maps``, ``math``, ``math/*``, ``mime``, ``mime/*``, ``net``, ``net/*``, ``os``, ``os/*``, ``path``, ``path/*``, ``plugin``, ``reflect``, ``reflect/*``, ``regexp``, ``regexp/*``, ``slices``, ``sort``, ``strconv``, ``strings``, ``sync``, ``sync/*``, ``syscall``, ``syscall/*``, ``testing``, ``testing/*``, ``text/*``, ``time``, ``time/*``, ``unicode``, ``unicode/*``, ``unsafe``, ``weak``",52,675,127
-    Totals,,688,1134,1580
+    Totals,,688,1135,1580
  • Changes to framework-coverage-go.csv:
- strings,,,47,,,,,,,,,,,,,,,,,,,,,,,46,1
+ strings,,,48,,,,,,,,,,,,,,,,,,,,,,,47,1

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The reinstated whole-slice flow lacks a targeted regression test.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Reinstates conservative taint flow through strings.Join when element-level access paths are unavailable.

Changes:

  • Adds whole-slice-to-return taint propagation for strings.Join.
File Description
go/​ql/​lib/​ext/​strings.model.yml Adds the imprecise strings.Join summary.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread go/ql/lib/ext/strings.model.yml
@github-actions github-actions Bot added the Go label Sep 22, 2026
@owen-mc
owen-mc marked this pull request as draft September 22, 2026 18:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Go no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants