{"id":"CVE-2020-25040","aliases":["ALPINE-CVE-2020-25040","EUVD-2021-1126","GHSA-jv9c-w74q-6762","UBUNTU-CVE-2020-25040","openSUSE-SU-2020:1497-1","openSUSE-SU-2020:1529-1","openSUSE-SU-2024:11384-1"],"status":"published","title":"Insecure permissions on build temporary rootfs in Singularity","description":"Sylabs Singularity through 3.6.2 has Insecure Permissions on temporary directories used in explicit and implicit container build operations, a different vulnerability than CVE-2020-25039.","severity":{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-10","score":0.0204,"percentile":0.81293,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-668","CWE-732"],"published":"2020-09-16T17:47:17Z","modified":"2026-11-03T06:32:31Z","fixes":[{"ecosystem":"Go","package":"github.com/sylabs/singularity","fixed_in":["3.6.3"],"sources":["ghsa","osv"]},{"ecosystem":"Alpine:v3.19","package":"singularity","fixed_in":["3.6.3-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.20","package":"singularity","fixed_in":["3.6.3-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.21","package":"singularity","fixed_in":["3.6.3-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.22","package":"singularity","fixed_in":["3.6.3-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.23","package":"singularity","fixed_in":["3.6.3-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.24","package":"singularity","fixed_in":["3.6.3-r0"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/sylabs/singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3"}]}]},{"source":"osv","ecosystem":"Alpine:v3.19","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.20","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.21","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.22","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.23","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.24","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3-r0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/sylabs/singularity","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.6.3"}]}]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"singularity-container","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.3.1-2","2.3.2-1","2.4.1-1","2.4.2-2","2.4.2-3","2.4.2-4","2.4.2-4ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:24.04:LTS","package":"singularity-container","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.1.1+ds2-1","4.1.1+ds2-1build1","4.1.1+ds2-1ubuntu0.1","4.1.1+ds2-1ubuntu0.2","4.1.1+ds2-1ubuntu0.2+esm1","4.1.1+ds2-1ubuntu0.3","4.1.1+ds2-1ubuntu0.3+esm1","4.1.1+ds2-1ubuntu0.3+esm2"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"singularity-container","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.1.5+ds4-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"singularity-container","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.1.5+ds4-1"]},{"source":"osv","ecosystem":"openSUSE:Leap 15.1","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3-lp152.2.6.1"}]}],"bundled":2},{"source":"osv","ecosystem":"openSUSE:Leap 15.2","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3-lp152.2.6.1"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Package Hub 15 SP2","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.3-bp152.2.8.1"}]}],"bundled":2},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"singularity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.8.3-1.2"}]}],"bundled":12}],"products":[{"vendor":"opensuse","product":"leap"},{"vendor":"sylabs","product":"singularity"}],"references":[{"url":"https://medium.com/sylabs","tags":["x_refsource_MISC","x_transferred","Product","web","report"]},{"url":"https://github.com/hpcng/singularity/security/advisories/GHSA-jv9c-w74q-6762","tags":["x_refsource_MISC","x_transferred","Mitigation","Third Party Advisory","advisory","web","report"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2020-09/msg00070.html","tags":["vendor-advisory","x_refsource_SUSE","x_transferred","Third Party Advisory","advisory","web"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2020-09/msg00088.html","tags":["vendor-advisory","x_refsource_SUSE","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-25040","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-jv9c-w74q-6762"},{"url":"https://security.alpinelinux.org/vuln/CVE-2020-25040","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2020-25040","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2020-25040","tags":["report"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/QKNKE5OJY3RKFINGTNXXOQ62VX3JCLB3/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1176705","tags":["report"]},{"url":"https://bugzilla.suse.com/1176707","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2020-25039","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2020-25040","tags":["web"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/JWGSXLM5VJNRINIIQEQESX2AWNIBZXWO/","tags":["advisory"]},{"url":"","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2018-12021","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2018-19295","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2019-11328","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2019-19724","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2020-13845","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2020-13846","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2020-13847","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2020-15229","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2021-29136","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2021-32635","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2020-25040","description":"Sylabs Singularity through 3.6.2 has Insecure Permissions on temporary directories used in explicit and implicit container build operations, a different vulnerability than CVE-2020-25039.","status":"published","published":"2020-09-16T17:47:17Z","modified":"2024-08-04T15:26:09.173Z","updated_at":"2026-11-02T14:35:48.52216Z"}],"euvd":[{"id":"EUVD-2021-1126","description":"Sylabs Singularity through 3.6.2 has Insecure Permissions on temporary directories used in explicit and implicit container build operations, a different vulnerability than CVE-2020-25039.","status":"published","published":"2020-09-16T17:47:17Z","modified":"2024-08-04T15:26:09Z","updated_at":"2026-11-03T03:07:18.192905Z"}],"ghsa":[{"id":"GHSA-jv9c-w74q-6762","title":"Insecure permissions on build temporary rootfs in Singularity","description":"### Impact\n\nInsecure permissions on temporary directories used in explicit and implicit container build operations.\n\nWhen a Singularity command that results in a container build operation is executed, it is possible for a user with access to the system to read the contents of the image during the build. Additionally, if the image contains a world-writable file or directory, it is possible for a user to inject arbitrary content into the running build, which in certain circumstances may enable arbitrary code execution during the build and/or when the built container is run.\n\n### Patches\n\nThis issue is addressed in Singularity 3.6.3.\n\nAll users are advised to upgrade to 3.6.3.\n\n### Workarounds\n\nThe issue is mitigated if `TMPDIR` is set to a location that is only accessible to the user, as any subdirectories directly under `TMPDIR` cannot then be accessed by others. However, this is difficult to enforce so it is not recommended to rely on this as a mitigation.\n\n### For more information\n\nGeneral questions about the impact of the advisory / changes made in the 3.6.0 release can be asked in the:\n\n* [Singularity Slack Channel](https://bit.ly/2m0g3lX)\n* [Singularity Mailing List](https://groups.google.com/a/lbl.gov/forum/??sdf%7Csort:date#!forum/singularity)\n\nAny sensitive security concerns should be directed to: security@sylabs.io\n\nSee our Security Policy here: https://sylabs.io/security-policy","status":"published","published":"2021-05-24T16:56:23Z","modified":"2023-02-01T05:06:05Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-668","CWE-732"],"updated_at":"2026-11-02T14:36:36.66596Z"}],"nvd":[{"id":"CVE-2020-25040","description":"Sylabs Singularity through 3.6.2 has Insecure Permissions on temporary directories used in explicit and implicit container build operations, a different vulnerability than CVE-2020-25039.","status":"published","published":"2020-09-16T18:15:13.547Z","modified":"2026-06-17T03:06:16.777Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"},{"version":"2.0","score":6.5,"vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-668"],"updated_at":"2026-11-02T14:06:15.83396Z"}],"osv":[{"id":"ALPINE-CVE-2020-25040","description":"Sylabs Singularity through 3.6.2 has Insecure Permissions on temporary directories used in explicit and implicit container build operations, a different vulnerability than CVE-2020-25039.","status":"published","published":"2020-09-16T18:15:13.547Z","modified":"2026-11-03T06:32:31.043980422Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-03T07:17:41.158523Z"},{"id":"CVE-2020-25040","description":"Sylabs Singularity through 3.6.2 has Insecure Permissions on temporary directories used in explicit and implicit container build operations, a different vulnerability than CVE-2020-25039.","status":"published","published":"2020-09-16T18:15:13.547Z","modified":"2026-10-24T10:50:22.821448698Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:44:15.879068Z"},{"id":"GHSA-jv9c-w74q-6762","title":"Insecure permissions on build temporary rootfs in Singularity","description":"### Impact\n\nInsecure permissions on temporary directories used in explicit and implicit container build operations.\n\nWhen a Singularity command that results in a container build operation is executed, it is possible for a user with access to the system to read the contents of the image during the build. Additionally, if the image contains a world-writable file or directory, it is possible for a user to inject arbitrary content into the running build, which in certain circumstances may enable arbitrary code execution during the build and/or when the built container is run.\n\n### Patches\n\nThis issue is addressed in Singularity 3.6.3.\n\nAll users are advised to upgrade to 3.6.3.\n\n### Workarounds\n\nThe issue is mitigated if `TMPDIR` is set to a location that is only accessible to the user, as any subdirectories directly under `TMPDIR` cannot then be accessed by others. However, this is difficult to enforce so it is not recommended to rely on this as a mitigation.\n\n### For more information\n\nGeneral questions about the impact of the advisory / changes made in the 3.6.0 release can be asked in the:\n\n* [Singularity Slack Channel](https://bit.ly/2m0g3lX)\n* [Singularity Mailing List](https://groups.google.com/a/lbl.gov/forum/??sdf%7Csort:date#!forum/singularity)\n\nAny sensitive security concerns should be directed to: security@sylabs.io\n\nSee our Security Policy here: https://sylabs.io/security-policy","status":"published","published":"2021-05-24T16:56:23Z","modified":"2026-07-08T05:59:53.778995632Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-668","CWE-732"],"updated_at":"2026-11-02T15:46:51.10002Z"},{"id":"UBUNTU-CVE-2020-25040","description":"Sylabs Singularity through 3.6.2 has Insecure Permissions on temporary directories used in explicit and implicit container build operations, a different vulnerability than CVE-2020-25039.","status":"published","published":"2020-09-16T18:15:00Z","modified":"2026-05-20T16:04:17.802899339Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:54:23.905183Z"},{"id":"openSUSE-SU-2020:1497-1","title":"Security update for singularity","description":"This update for singularity fixes the following issues:\n\nNew version 3.6.3, addresses the following security issues:\n\n- CVE-2020-25039, boo#1176705\n\n  When a Singularity action command (run, shell, exec) is run with \n  the fakeroot or user namespace option, Singularity will extract \n  a container image to a temporary sandbox directory. \n  Due to insecure permissions on the temporary directory it is possible \n  for any user with access to the system to read the contents of the image. \n  Additionally, if the image contains a world-writable file or directory, \n  it is possible for a user to inject arbitrary content into the running \n  container. \n\n- CVE-2020-25040, boo#1176707\n\n  When a Singularity command that results in a container \n  build operation is executed, it is possible for a user with access \n  to the system to read the contents of the image during the build. \n  Additionally, if the image contains a world-writable file or directory, \n  it is possible for a user to inject arbitrary content into the running \n  build, which in certain circumstances may enable arbitrary code execution \n  during the build and/or when the built container is run.\n\nNew version 3.6.2, new features / functionalities:\n\n  -Add --force option to singularity delete for non-interactive \n   workflows.\n  -Support compilation with FORTIFY_SOURCE=2 and build in pie mode \n   with fstack-protector enabled\n  - Changed defaults / behaviours\n   -Default to current architecture for singularity delete.\n  - Bug Fixes\n   -Respect current remote for singularity delete command.\n   -Allow rw as a (noop) bind option.\n   -Fix capability handling regression in overlay mount.\n   -Fix LD_LIBRARY_PATH environment override regression with --nv/--rocm.\n   -Fix environment variable duplication within singularity engine.\n   -Use -user-xattrs for unsquashfs to avoid error with rootless \n    extraction using unsquashfs 3.4\n   -Correct --no-home message for 3.6 CWD behavior.\n   -Don't fail if parent of cache dir not accessible.\n   -Fix tests for Go 1.15 Ctty handling.\n   -Fix additional issues with test images on ARM64.\n   -Fix FUSE e2e tests to use container ssh_config.\n   -Provide advisory message r.e. need for upper and work to exist \n    in overlay images.\n   -Use squashfs mem and processor limits in squashfs gzip check.\n   -Ensure build destination path is not an empty string - do not \n    overwrite CWD.\n   -Don't unset PATH when interpreting legacy /environment files.\n","status":"published","published":"2020-09-21T18:21:22Z","modified":"2026-02-04T03:12:56.481564Z","updated_at":"2026-11-02T16:58:31.517538Z"},{"id":"openSUSE-SU-2020:1529-1","title":"Security update for singularity","description":"This update for singularity fixes the following issues:\n\nNew version 3.6.3, addresses the following security issues:\n\n- CVE-2020-25039, boo#1176705\n\n  When a Singularity action command (run, shell, exec) is run with \n  the fakeroot or user namespace option, Singularity will extract \n  a container image to a temporary sandbox directory. \n  Due to insecure permissions on the temporary directory it is possible \n  for any user with access to the system to read the contents of the image. \n  Additionally, if the image contains a world-writable file or directory, \n  it is possible for a user to inject arbitrary content into the running \n  container. \n\n- CVE-2020-25040, boo#1176707\n\n  When a Singularity command that results in a container \n  build operation is executed, it is possible for a user with access \n  to the system to read the contents of the image during the build. \n  Additionally, if the image contains a world-writable file or directory, \n  it is possible for a user to inject arbitrary content into the running \n  build, which in certain circumstances may enable arbitrary code execution \n  during the build and/or when the built container is run.\n\nNew version 3.6.2, new features / functionalities:\n\n  -Add --force option to singularity delete for non-interactive \n   workflows.\n  -Support compilation with FORTIFY_SOURCE=2 and build in pie mode \n   with fstack-protector enabled\n  - Changed defaults / behaviours\n   -Default to current architecture for singularity delete.\n  - Bug Fixes\n   -Respect current remote for singularity delete command.\n   -Allow rw as a (noop) bind option.\n   -Fix capability handling regression in overlay mount.\n   -Fix LD_LIBRARY_PATH environment override regression with --nv/--rocm.\n   -Fix environment variable duplication within singularity engine.\n   -Use -user-xattrs for unsquashfs to avoid error with rootless \n    extraction using unsquashfs 3.4\n   -Correct --no-home message for 3.6 CWD behavior.\n   -Don't fail if parent of cache dir not accessible.\n   -Fix tests for Go 1.15 Ctty handling.\n   -Fix additional issues with test images on ARM64.\n   -Fix FUSE e2e tests to use container ssh_config.\n   -Provide advisory message r.e. need for upper and work to exist \n    in overlay images.\n   -Use squashfs mem and processor limits in squashfs gzip check.\n   -Ensure build destination path is not an empty string - do not \n    overwrite CWD.\n   -Don't unset PATH when interpreting legacy /environment files.\n\nThis update was imported from the openSUSE:Leap:15.2:Update update project.","status":"published","published":"2020-09-25T10:22:50Z","modified":"2026-02-04T02:47:33.953449Z","updated_at":"2026-11-02T16:58:31.517538Z"},{"id":"openSUSE-SU-2024:11384-1","title":"singularity-3.8.3-1.2 on GA media","description":"These are all security issues fixed in the singularity-3.8.3-1.2 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2026-02-04T02:36:28.928556Z","updated_at":"2026-11-02T16:58:35.195147Z"}]}}
