LINUX.ORG.RU

CVE-2014-6271: Удалённое выполнение кода через bash

 ,


2

4

Сабж. Подробнее. Немного болтовни от RH, включает векторы атаки Предлагаемый патч (RH)

Current bash versions use an environment variable named by the function name, and a function definition starting with “() {” in the variable value to propagate function definitions through the environment. The vulnerability occurs because bash does not stop after processing the function definition; it continues to parse and execute shell commands following the function definition. For example, an environment variable setting of

VAR=() { ignored; }; /bin/id

will execute /bin/id when the environment is imported into the bash process. (The process is in a slightly undefined state at this point. The PATH variable may not have been set up yet, and bash could crash after executing /bin/id, but the damage has already happened at this point.)

The major attack vectors that have been identified in this case are HTTP requests and CGI scripts. Here is a sample

If you have a username in your authorization header this could also be an attack vector.

Another attack surface is OpenSSH through the use of AcceptEnv variables. As well through TERM and SSH_ORIGINAL_COMMAND. An environmental variable with an arbitrary name can carry a nefarious function which can enable network exploitation. This is fire bad.

Это, мягко говоря, СЕРЬЁЗНО.

★★★★★

Последнее исправление: x3al (всего исправлений: 4)

Ответ на: комментарий от Shadow1251

Another attack surface is OpenSSH through the use of AcceptEnv variables.

И этим дело не заканчивается. Убирать bash из шеллов всех юзеров и проверять каждый shebang?

x3al ★★★★★
() автор топика

я не понимаю как это можно эксплуатировать?

вот например eval переменной $PS4 от рута в лимитированном sudo - ясно, а тут?

bl ★★★
()
Ответ на: комментарий от bl

Вторая цитата для Ъ. Быдлокода на баше, который может быть связан с интернетами — полно.

x3al ★★★★★
() автор топика
Ответ на: комментарий от Black_Shadow

как удаленно изменить переменную среды окружения?
в примере приводится случай «в конфиг сетевухи положить». если иметь возможность положить в конфиг сетевухи, тогда почему нельзя положить в /etc/profile ?

bl ★★★
()
Ответ на: комментарий от x3al

А за юзеров то что переживать, privilege escalation ведь нет? Ведь openssh+AcceptEnv относится к случаю, когда у пользователя вместо интерактивного шела запускается bash-cкрипт. Или я не правильно понял?

mky ★★★★★
()
Ответ на: комментарий от mky

Ограниченный шелл может быть bash-скриптом. Когда вместо доступа к тому же git у людей внезапно появляется шелл — это privilege escalation.

x3al ★★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.