Cix exec transitions are not scrubbing the environment upon fallback
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
AppArmor |
Invalid
|
Medium
|
Unassigned |
Bug Description
# Important: Ensure that a profile named "DNE" does not exist
$ echo "profile test { /** rwm, /bin/cat Cix -> DNE, signal, unix, }" | sudo apparmor_parser -qr
$ aa-exec -p test -- bash -c 'LD_SHOW_AUXV=1 /bin/cat /proc/self/
AT_HWCAP: bfebfbff
AT_PAGESZ: 4096
AT_CLKTCK: 100
AT_PHDR: 0x400040
AT_PHENT: 56
AT_PHNUM: 9
AT_BASE: 0x7fc31335e000
AT_FLAGS: 0x0
AT_ENTRY: 0x4025b0
AT_UID: 1000
AT_EUID: 1000
AT_GID: 1000
AT_EGID: 1000
AT_SECURE: 0
AT_RANDOM: 0x7ffe357e0349
AT_EXECFN: /bin/cat
AT_PLATFORM: x86_64
test (enforce)
Note that AT_SECURE is 0. Also, LD_SHOW_AUXV is an environment variable that is scrubbed when AT_SECURE is set so libc shouldn't have even dumped the auxiliary vector.
I believe the Cix test is not written correctly. Try this:
$ echo "profile test { file, /bin/true Cix -> true, signal, unix, profile true { file, } }" | sudo apparmor_parser -qr
$ aa-exec -p test -- bash -c 'LD_SHOW_AUXV=1 /bin/true'
$
Thanks