| Summary: | uudecode doesn't recognise the special decode_pathname /dev/stdout | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Christoph Anton Mitterer <calestyo> |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | busybox-cvs, calestyo |
| Priority: | P5 | ||
| Version: | 1.30.x | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: |
uudecode-stdout-symbols-v1.patch
uudecode-stdout-symbols-v2.patch |
||
|
Description
Christoph Anton Mitterer
2021-09-29 02:49:28 UTC
I've just seen that GNU's uudecode is documented to take both /dev/stdout AND - as special symbols. So I'd suggest that busybox does the same, regardless of what POSIX would say. Created attachment 9096 [details]
uudecode-stdout-symbols-v1.patch
I've attached a patch, which should fix the issue (but someone with more knowledge on busybox should double check ;-) ). Also it updates docs/posix_conformance.txt because uudecode clearly has -o, but I'm not sure whether it's POSIX-compliant or not (that would also require things like file permission bits restoration and so, I guess). I've also increased severity, cause I think such a bug could at least potentially have security implications (imagine a user wants to make sure data is written to stdout and uses -o /dev/stdout for that) but in fact the data (which may be confidential) is written to a fresh file /dev/stdout, where everyone can read it. Created attachment 9101 [details]
uudecode-stdout-symbols-v2.patch
Fixed in git. Any reason why you make this dependent on ENABLE_DESKTOP? I mean POSIX is quite clear... it should simply always behave that way and especially not doing so can lead to security issues on systems where /dev/stdout doesn't exists as a file (which is linked to FD1). I've reopened this... cause it seems ENABLE_DESKTOP is not enabled per default, and even if one chooses to enable it, several other things also change their behaviour. So the problem is that the default setup of busybox' uudecode still behaves wrong and is thus vulnerable. I should perhaps add one thing: IMO it's okay to make features configurable, but only if the tool in question fails kinda gracefully if it was disabled. "Gracefully" in the sense, that the failure is not expected by POSIX, but still detectable by checking the exit status So for example: if busybox' tr supports disabling character classes, fine, but only if tr then fails with some non-zero exit status whenever it encounters such character class. The same would go here: If busybox' uuencode was compiled without support for the symbol "/dev/stdout" it should then fail whnever that string is used. Otherwise one cannot reliably use it, when one cannot know how it was compiled. > cause it seems ENABLE_DESKTOP is not enabled per default
ENABLE_DESKTOP is enabled per default.
I think this bug is closed.
Just for the records, if someone ever stumbles over this: It seems as if "-" might also be standardised as a "special symbol" (just like the string /dev/stdout is) with the next revision of POSIX. See https://www.austingroupbugs.net/view.php?id=1544 The string "/dev/stdout" would however not be dropped from being required, too. |