Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Redhat Securityblog: Bash specially-crafted environment variables code injection attack

[es] :: Security :: Redhat Securityblog: Bash specially-crafted environment variables code injection attack

[ Pregleda: 4152 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

obrad_beocin
Beocin

Član broj: 12133
Poruke: 34
*.dynamic.isp.telekom.rs.



Profil

icon Redhat Securityblog: Bash specially-crafted environment variables code injection attack25.09.2014. u 21:34 - pre 95 meseci
Na Redhat Securityblog-u objavljeno je sledeće obaveštenje koje treba vrlo ozbiljno shvatiti:
https://securityblog.redhat.co...riables-code-injection-attack/

Update 2014-09-25 16:00 UTC

Red Hat is aware that the patch for CVE-2014-6271 is incomplete. An attacker can provide specially-crafted environment variables containing arbitrary commands that will be executed on vulnerable systems under certain conditions. The new issue has been assigned CVE-2014-7169.
We are working on patches in conjunction with the upstream developers as a critical priority. For details on a workaround, please see the knowledgebase article.
Red Hat advises customers to upgrade to the version of bash which contains the fix for CVE-2014-6271 and not wait for the patch which fixes CVE-2014-7169. CVE-2014-7169 is a less severe issue and patches for it are being worked on.

Bash or the Bourne again shell, is a UNIX like shell, which is perhaps one of the most installed utilities on any Linux system. From its creation in 1980, bash has evolved from a simple terminal based command interpreter to many other fancy uses.

In Linux, environment variables provide a way to influence the behavior of software on the system. They typically consists of a name which has a value assigned to it. The same is true of the bash shell. It is common for a lot of programs to run bash shell in the background. It is often used to provide a shell to a remote user (via ssh, telnet, for example), provide a parser for CGI scripts (Apache, etc) or even provide limited command execution support (git, etc)

Coming back to the topic, the vulnerability arises from the fact that you can create environment variables with specially-crafted values before calling the bash shell. These variables can contain code, which gets executed as soon as the shell is invoked. The name of these crafted variables does not matter, only their contents. As a result, this vulnerability is exposed in many contexts, for example:

ForceCommand is used in sshd configs to provide limited command execution capabilities for remote users. This flaw can be used to bypass that and provide arbitrary command execution. Some Git and Subversion deployments use such restricted shells. Regular use of OpenSSH is not affected because users already have shell access.
Apache server using mod_cgi or mod_cgid are affected if CGI scripts are either written in bash, or spawn subshells. Such subshells are implicitly used by system/popen in C, by os.system/os.popen in Python, system/exec in PHP (when run in CGI mode), and open/system in Perl if a shell is used (which depends on the command string).
PHP scripts executed with mod_php are not affected even if they spawn subshells.
DHCP clients invoke shell scripts to configure the system, with values taken from a potentially malicious server. This would allow arbitrary commands to be run, typically as root, on the DHCP client machine.
Various daemons and SUID/privileged programs may execute shell scripts with environment variable values set / influenced by the user, which would allow for arbitrary commands to be run.
Any other application which is hooked onto a shell or runs a shell script as using bash as the interpreter. Shell scripts which do not export variables are not vulnerable to this issue, even if they process untrusted content and store it in (unexported) shell variables and open subshells.
Like “real” programming languages, Bash has functions, though in a somewhat limited implementation, and it is possible to put these bash functions into environment variables. This flaw is triggered when extra code is added to the end of these function definitions (inside the enivronment variable). Something like:

$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test
The patch used to fix this flaw, ensures that no code is allowed after the end of a bash function. So if you run the above example with the patched version of bash, you should get an output similar to:

$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a test
We believe this should not affect any backward compatibility. This would, of course, affect any scripts which try to use environment variables created in the way as described above, but doing so should be considered a bad programming practice.

Red Hat has issued security advisories that fixes this issue for Red Hat Enterprise Linux. Fedora has also shipped packages that fixes this issue.

We have additional information regarding specific Red Hat products affected by this issue that can be found at https://access.redhat.com/site/solutions/1207723

Information on CentOS can be found at http://lists.centos.org/piperm...tos/2014-September/146099.html.
 
Odgovor na temu

jorganwd
Muris Kurgaš
/dev/null

Član broj: 65537
Poruke: 777

Sajt: www.remote-exploit.org


+32 Profil

icon Re: Redhat Securityblog: Bash specially-crafted environment variables code injection attack25.09.2014. u 21:50 - pre 95 meseci
Već postoji tehnika zaobilaženja zakrpe koju su objavili. Već probao, igrao se i kroz cgi-bin i lokalno. Znači radi. Samo još uvijek nisam skontao, doduše nisam se ni potrudio da potražim, koje to komercijalne/opensource aplikacije koriste bash kroz cgi-bin pa da se čovjek zabrine. Ima li neko informaciju?
 
Odgovor na temu

plus_minus

Član broj: 289459
Poruke: 2242
*.dynamic.isp.telekom.rs.

Sajt: https://hardcoder.xyz


+2246 Profil

icon Re: Redhat Securityblog: Bash specially-crafted environment variables code injection attack25.09.2014. u 22:12 - pre 95 meseci
Ja sam trenutno na F20 (heisenbug), lepo znati. No, bash verzija je kod mene ona koja treba da bude `bash-4.2.47-3.fc20.x86_64`, tako da je ovo već odavno prošlost kako kod mene, tako i kod svih, najverovatnije.
about:networking
 
Odgovor na temu

jorganwd
Muris Kurgaš
/dev/null

Član broj: 65537
Poruke: 777

Sajt: www.remote-exploit.org


+32 Profil

icon Re: Redhat Securityblog: Bash specially-crafted environment variables code injection attack26.09.2014. u 08:23 - pre 95 meseci
Citat:
plus_minus: Ja sam trenutno na F20 (heisenbug), lepo znati. No, bash verzija je kod mene ona koja treba da bude `bash-4.2.47-3.fc20.x86_64`, tako da je ovo već odavno prošlost kako kod mene, tako i kod svih, najverovatnije.


Vrata ne znaš da li si ispravno zaključao dok ne stisneš kvaku.
 
Odgovor na temu

plus_minus

Član broj: 289459
Poruke: 2242
*.dynamic.isp.telekom.rs.

Sajt: https://hardcoder.xyz


+2246 Profil

icon Re: Redhat Securityblog: Bash specially-crafted environment variables code injection attack26.09.2014. u 13:56 - pre 95 meseci
Slažem se. Fora je u tome što nisam ni primetio kada sam dobio novu bash verziju, možda još pri prvoj 'apper' kuknjavi odmah nakon instalacije .. i to je vrlo moguće isti slučaj sa svima koji koriste Rh/fc/CentOS.
about:networking
 
Odgovor na temu

jorganwd
Muris Kurgaš
/dev/null

Član broj: 65537
Poruke: 777

Sajt: www.remote-exploit.org


+32 Profil

icon Re: Redhat Securityblog: Bash specially-crafted environment variables code injection attack28.09.2014. u 06:05 - pre 95 meseci
Nego daj neka me neko prosvijetli šta je to ranjivo od aplikacija komercijalnih/open-source kroz cgi-bin pa da se zabrinem.
 
Odgovor na temu

jorganwd
Muris Kurgaš
/dev/null

Član broj: 65537
Poruke: 777

Sajt: www.remote-exploit.org


+32 Profil

icon Re: Redhat Securityblog: Bash specially-crafted environment variables code injection attack09.10.2014. u 08:36 - pre 95 meseci
I evo jednog lijepog primjera http://www.exploit-db.com/exploits/34879/
 
Odgovor na temu

[es] :: Security :: Redhat Securityblog: Bash specially-crafted environment variables code injection attack

[ Pregleda: 4152 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.