{"id":"GHSA-vv6c-69r6-chg9","aliases":["GHSA-vv6c-69r6-chg9","GO-2024-3199"],"related":[],"kind":"vulnerability","state":"published","title":"Go-Landlock in best-effort mode did not restrict TCP bind and connect operations correctly","summary":"### Impact\nWhen using the recommended \"best-effort\" mode, Go-Landlock did not restrict the TCP bind() and connect() operations any more when they were requested.  This affects Go-Landlock users to whom both of the following conditions apply:\n\n* They use Landlock rulesets that are supposed to restrict networking (through `landlock.V4`, `landlock.V5`, or self-configured).\n* These Landlock rulesets are used in best-effort mode.\n\nTypically, affected code uses the Go-Landlock API like this (the crucial part being the combination of `V4`/`V5` and `.BestEffort()`):\n\n```\nerr := landlock.V5.BestEffort().Restrict(...)\n```\n\n* This is a bug in the Go-Landlock library and does not affect programs that use Landlock via C or other language bindings.\n* The bug only affects networking restrictions. File system restrictions continue to work as expected.\n\n### Patches\nPatched in: https://github.com/landlock-lsm/go-landlock/commit/fb3ad845df462d013f9c8a965c496617c6a5778b\nUsers should upgrade to: v0.0.0-20241013234402-fb3ad845df46\n\nGo package dependencies can be updated using `go get -u` from the project directory.\n\nProjects on Github might get notified by Dependabot, once this advisory is public.\n\n### Workarounds\nNone.\n\n### References\nCurrently none.\n\n[The existing users of Go-Landlock on Github](https://pkg.go.dev/github.com/landlock-lsm/go-landlock/landlock?tab=importedby) have the following bugs filed:\n* https://github.com/Foxboron/ssh-the-planet/issues/1\n* https://github.com/ngergs/websrv/issues/15\n* https://github.com/pufferffish/wireproxy/issues/142","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"### Impact\nWhen using the recommended \"best-effort\" mode, Go-Landlock did not restrict the TCP bind() and connect() operations any more when they were requested.  This affects Go-Landlock users to whom both of the following conditions apply:\n\n* They use Landlock rulesets that are supposed to restrict networking (through `landlock.V4`, `landlock.V5`, or self-configured).\n* These Landlock rulesets are used in best-effort mode.\n\nTypically, affected code uses the Go-Landlock API like this (the crucial part being the combination of `V4`/`V5` and `.BestEffort()`):\n\n```\nerr := landlock.V5.BestEffort().Restrict(...)\n```\n\n* This is a bug in the Go-Landlock library and does not affect programs that use Landlock via C or other language bindings.\n* The bug only affects networking restrictions. File system restrictions continue to work as expected.\n\n### Patches\nPatched in: https://github.com/landlock-lsm/go-landlock/commit/fb3ad845df462d013f9c8a965c496617c6a5778b\nUsers should upgrade to: v0.0.0-20241013234402-fb3ad845df46\n\nGo package dependencies can be updated using `go get -u` from the project directory.\n\nProjects on Github might get notified by Dependabot, once this advisory is public.\n\n### Workarounds\nNone.\n\n### References\nCurrently none.\n\n[The existing users of Go-Landlock on Github](https://pkg.go.dev/github.com/landlock-lsm/go-landlock/landlock?tab=importedby) have the following bugs filed:\n* https://github.com/Foxboron/ssh-the-planet/issues/1\n* https://github.com/ngergs/websrv/issues/15\n* https://github.com/pufferffish/wireproxy/issues/142","format":"markdown","source":"ghsa"},{"lang":"en","text":"Go-Landlock in best-effort mode did not restrict TCP bind and connect operations correctly in github.com/landlock-lsm/go-landlock.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: .","format":"markdown","source":"go"}],"published":"2024-10-14T20:30:25.000Z","modified":"2024-10-15T16:12:13.340Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"LOW"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"LOW"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-20240109","status":"affected","fixed":"0.0.0-20241013234402-fb3ad845df46"}],"ecosystem":"Go","package":"github.com/landlock-lsm/go-landlock","purl":"pkg:golang/github.com/landlock-lsm/go-landlock","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20241013234402-fb3ad845df46"}],"ecosystem":"Go","package":"github.com/landlock-lsm/go-landlock","purl":"pkg:golang/github.com/landlock-lsm/go-landlock","source":"go"}],"references":[{"url":"https://github.com/landlock-lsm/go-landlock/security/advisories/GHSA-vv6c-69r6-chg9","tags":["advisory","web"],"sources":["ghsa","go"]},{"url":"https://github.com/landlock-lsm/go-landlock/commit/fb3ad845df462d013f9c8a965c496617c6a5778b","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/landlock-lsm/go-landlock","tags":["package"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vv6c-69r6-chg9","url":"https://github.com/advisories/GHSA-vv6c-69r6-chg9","licence":"CC-BY-4.0","modified":"2024-10-15T16:12:13.340Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2024-3199","url":"https://pkg.go.dev/vuln/GO-2024-3199","licence":"CC-BY-4.0","modified":"2024-10-15T16:12:13.340Z"}],"updatedAt":"2026-11-25T22:56:23.876Z"}