Skip to content

Go: Remove outdated deprecated library APIs - #23187

Draft
jketema wants to merge 3 commits into
mainfrom
jketema/dep-go
Draft

jketema wants to merge 3 commits into
mainfrom
jketema/dep-go

Conversation

@jketema

@jketema jketema commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Remove obsolete framework, scope, location, and data-flow APIs identified by config/blame-deprecations.mjs. Remove imports of empty compatibility modules. Keep experimental queries unchanged.

Remove obsolete framework, scope, location, and data-flow APIs identified by config/blame-deprecations.mjs. Preserve Afero file-access and fasthttp request-body source modeling with private implementations, and remove imports of empty compatibility modules. Keep experimental queries unchanged.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7be1d7da-9061-47a8-bf98-b3169476add9
Regenerate test expectations to remove obsolete FunctionModel provenance and direct local-taint edges. Preserve expected alerts, sources, and sinks.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: c467897f-62f7-4d80-8def-3a2f24c8763c
Comment on lines +172 to +175
requestCtx.Request.ReadBody(&bufio.Reader{}, 100, 1000) // $ RemoteFlowSource="&... [postupdate]"
requestCtx.Request.ReadLimitBody(&bufio.Reader{}, 100) // $ RemoteFlowSource="&... [postupdate]"
requestCtx.Request.ContinueReadBodyStream(&bufio.Reader{}, 100, true) // $ RemoteFlowSource="&... [postupdate]"
requestCtx.Request.ContinueReadBody(&bufio.Reader{}, 100) // $ RemoteFlowSource="&... [postupdate]"

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.

These lost results are fine. If you mark an argument of a function call as a source then MaD makes it the post-update node of the argument that is the source, whereas the old QL models made it the argument itself.

| strings.go:11:42:11:45 | "%q" | strings.go:11:30:11:50 | call to Sprintf |
| strings.go:11:48:11:49 | s2 | strings.go:11:30:11:50 | call to Sprintf |
| strings.go:11:54:11:69 | call to Sprintln | strings.go:11:9:11:69 | ...+... |
| strings.go:11:67:11:68 | s3 | strings.go:11:54:11:69 | call to Sprintln |

@owen-mc owen-mc Nov 20, 2026 •

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.

These lost alerts need some care. The QL model that you're removing gave a local taint step from arguments corresponding to the variadic parameter of fmt.Sprint (and friends) to its return value. The MaD model that is meant to replace it instead involves reading the arguments from the "varargs array". There is an open PR to deal with some complications around this. We should definitely do DCA to check this doesn't cause issues. I guess if it does then we would catch it at release QA anyway.

@owen-mc

owen-mc commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

To be clear, the approval is subject to running DCA and there being no alert changes.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants