CVE-2018-20483: wget --xattr leaks HTTP Basic-Auth credentials into user.xdg.origin.url
9258273a-a1dc-4b49-91e2-b267ece125a2
CVE-2018-20483 — wget ≤1.19 with --xattr (or opt.enable_xattr) persists the raw origin URL into the user.xdg.origin.url POSIX extended attribute of the downloaded file. The raw URL includes any HTTP/FTP basic-auth credentials the user embedded in it (e.g. http://user:password@host/path). Because user.* xattrs are readable by anyone who can read the file, the credentials leak to other local users, archive recipients, hosting providers, etc. The same issue applies to the user.xdg.referrer.url xattr written when redirects occur. Bug class: information-leak.
Steps:
grep -rn set_file_metadata src/→ src/xattr.c (definition), src/http.c, src/ftp.c (callers).- Read src/xattr.c lines 59-79: set_file_metadata calls write_xattr_metadata("user.xdg.origin.url", escnonprint_uri(origin_url), fp) which delegates to fsetxattr(fd, name, value, strlen(value), 0).
- Read src/http.c around line 3949-3956: callers pass
u->url(andoriginal_url->url) directly — the raw URL string the user supplied. - Read src/ftp.c around line 1582-1585: same pattern —
set_file_metadata(u->url, NULL, fp). - Confirm
u->urlis the raw original URL: src/url.h line 83 —char *url; /* Original URL */insidestruct url. The struct also has separateuser/passwdfields (lines 99-101), which means the userinfo is NOT stripped fromurl. - wget already has a credential-redacting helper: src/url.h line 59-63 defines
enum url_auth_mode { URL_AUTH_SHOW, URL_AUTH_HIDE_PASSWD, URL_AUTH_HIDE }and line 129 declareschar *url_string(const struct url *, enum url_auth_mode);— but set_file_metadata never calls it.
Useful grep patterns: grep -rn 'set_file_metadata' src/ grep -n 'struct url' src/url.h grep -n 'url_auth_mode|URL_AUTH_' src/url.h