Хакеры используют новую уязвимость. под угрозой половина интернета

Что такое Логгеры (Logger) в Java?

Логгеры (Logger) в Java — это объекты, которые запускают события журнала. Они создаются и вызываются в коде приложения, где генерируют события журнала перед передачей их следующему компоненту, который является Appender.

Вы можете использовать несколько логгеров в одном классе для ответа на различные события или использовать в иерархии. Они обычно называются с использованием иерархического пространства имен, разделенных точками. Кроме того, все имена Logger должны основываться на классе или имени пакета зарегистрированного компонента.

Кроме того, каждый логгер отслеживает ближайшего существующего предка в пространстве имен, а также имеет связанный с ним «уровень».

Файл свойств пакета Log4j и Java Util

Пример файла свойств Log4j

# Enable Root logger option
log4j.rootLogger=INFO, file, stdout
# Attach appenders to print file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=E:loglogging.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
# Attach appenders to print on console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
  • Файл свойств Log4j создается внутри папки src проекта.
  • log4j.appender.file = org.apache.log4j.RollingFileAppender -> Печатает все журналы в файле
  • log4j.appender.stdout = org.apache.log4j.ConsoleAppender -> Печатает все журналы в консоли
  • log4j.appender.file.File = D: loglogging.log -> Указывает расположение файла журнала
  • log4j.appender.file.MaxFileSize = 10 МБ -> Максимальный размер файла журнала до 10 МБ
  • log4j.appender.file.MaxBackupIndex = 5 -> Ограничивает количество файлов резервных копий до 5
  • log4j.appender.file.layout = org.apache.log4j.PatternLayout -> Указывает шаблон, в котором журналы будут печататься в файл журнала.
  • log4j.appender.file.layout.ConversionPattern =% d {гггг-ММ-дд ЧЧ: мм: сс}% -5p% c {1}:% L -% m% n -> Устанавливает шаблон преобразования по умолчанию.

Пример файла свойств пакета Java Util

handlers= java.util.logging.ConsoleHandler

.level= WARNING

# Output will be stored in the default directory
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 60000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter

# Level of logs will be limited to WARNING and above.
java.util.logging.ConsoleHandler.level = WARNING
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

Здесь

  • java.util.logging.FileHandler.pattern =% h / java% u.log -> Файлы журнала будут записаны в C: TEMPjava1.log
  • java.util.logging.FileHandler.limit = 50000 -> Максимальная сумма, которую регистратор записывает в один файл в байтах.
  • java.util.logging.FileHandler.count = 1 -> Указывает количество выходных файлов
  • java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter -> Упоминает форматер, используемый для форматирования. Здесь используется XML Formatter.
  • java.util.logging.ConsoleHandler.level = WARNING -> Устанавливает уровень журнала по умолчанию для WARNING
  • java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -> Указывает форматер, используемый всеми ConsoleHandler. Здесь используется SimpleFormatter.

10. Уязвимость протокола HTTP/2

Это целая серия уязвимостей, которая была обнаружена в 2016 году  в протоколе HTTP/2. Они получили коды CVE-2015-8659, CVE-2016-0150, CVE-2016-1546, CVE-2016-2525, CVE-2016-1544. Уязвимостям были подвержены все реализации этого протокола в Apache, Nginx Microsoft, Jetty и nghttp2.

Все они позволяют злоумышленнику очень сильно замедлить работу веб-сервера и выполнить атаку отказ от обслуживания. Например, одна из ошибок приводила к возможности отправки небольшого сообщения, которое на сервере распаковывалось в гигабайты. Ошибка была очень быстро исправлена и поэтому не вызвала много шума в сообществе.

How does Log4Shell affect consumers?

Many companies and organizations use the Log4j library in numerous applications and infrastructure, either directly, or through third-party use. In the consumer sector, much network-enabled storage and smart home equipment also use the Log4j 2 library. Users should disconnect them from the Internet until their manufacturers make updates available.

Most companies have placed a corresponding security message on their websites describing what they are doing about the Log4j vulnerability.

Consumers should install software updates provided by the vendors they use. They should also try to find out whether Log4Shell affects the organizations that host the sites and services they use. If so, they should find out what measures the organizations are taking to safeguard their personal information.

What is Log4Shell?

Log4Shell is a software vulnerability in Apache Log4j 2, a popular Java library for logging error messages in applications. The vulnerability, published as CVE-2021-44228, enables a remote attacker to take control of a device on the internet if the device is running certain versions of Log4j 2.

for CVE-2021-44228, version 2.15, on December 6, 2021. However, this patch left part of the vulnerability unfixed, resulting in CVE-2021-45046 and a second patch, version 2.16, released on December 13. Apache released a third patch, version 2.17, on December 17 to fix another related vulnerability, CVE-2021-45105. They released a fourth patch, 2.17.1, on December 28 to address another vulnerability, CVE-2021-44832.

Attackers can exploit the vulnerability using text messages to control a computer remotely. The Apache Software Foundation, which publishes the Log4j 2 library, gave the vulnerability a CVSS score of 10 out of 10, the highest-level severity score, because of its potential for widespread exploitation and the ease with which malicious attackers can exploit it. While mitigation evolves and the damage unfolds, the fundamentals of the Log4j vulnerability won’t change.

Log4j 2 Garbage Free Logging

With Log4j 2.6 a partially implemented garbage-free logging was introduced. The framework reuses objects stored in ThreadLocal and tries to reuse buffers when converting text to bytes.

With the 2.6 version of the framework, two properties are used to control the garbage-free logging capabilities of Log4j 2. The log4j2.enableThreadlocals which is by default set to true for non-web applications and the log4j2.enableDirectEncoders which is also set to true by default are the ones that enable optimizations in Log4j 2.

With the 2.7 version of the framework, the third property was added – the log4j2.garbagefreeThreadContextMap. If set to true the ThreadContext map will also use a garbage-free approach. By default, this property is set to false.

There is a set of limitations when it comes to garbage-free logging in Log4j 2. Not all filters, appenders, and layouts are available. If you decide to use it check Log4j 2 documentation on that topic.

For mission-critical systems tuning the Java garbage collection process is crucial for stability and efficiency. Having a logging library that can potentially generate a lot of distinct String instances, support garbage-free logging is a feature that is welcomed by a lot of developers and DevOps.

How bad is Log4Shell?

The simple answer is “very bad”! The Log4Shell vulnerability was first spotted in Minecraft. Microsoft rolled out an emergency patch to fix this problem quickly. TechCrunch reports that Apple, Amazon, Twitter, and Cloudflare are vulnerable to the Log4Shell attack. Per TechCrunch, “The Computer Emergency Response Team (CERT) for New Zealand, Deutsche Telekom’s CERT, and the Greynoise web monitoring service have all warned that attackers are actively looking for servers vulnerable to Log4Shell attacks. According to the latter, around 100 distinct hosts are scanning the internet for ways to exploit Log4j vulnerability.”

Detecting the Vulnerability with Qualys WAS

For details on Qualys WAS Log4Shell detection, please refer to: https://blog.qualys.com/vulnerabilities-threat-research/2021/12/15/is-your-web-application-exploitable-by-log4shell-cve-2021-44228-vulnerability

Qualys WAS Research team has released 150440 QID to production in order to detect the web applications vulnerable to apache log4j2 zero-day vulnerability (CVE-2021-44228). 

On affected versions of Log4j, a zero-day vulnerability exists in JNDI (Java Naming and Directory Interface) features, which was made public on December 9, 2021 that results in remote code execution (RCE).

The WAS module is using our Out Of Band detection mechanism to inject payloads into the following headers listed below.  The following request headers will be tested:

  1. X-Api-Version
  2. User-Agent
  3. Referer
  4. X-Druid-Comment
  5. Origin
  6. Location
  7. X-Forwarded-For
  8. Cookie
  9. X-Requested-With
  10. X-Forwarded-Host
  11. Accept

We are working on other headers and will update our signatures as needed. 

The above headers will be tested at the base URl and several directories up and down (adhering to scope rules) to ensure each application is thoroughly tested.

As part of the test to detect the presence of the vulnerability WAS engine sends a HTTP GET request with a specially crafted payload inside Request headers, where vulnerable servers will make a DNS query that will trigger Qualys Periscope detection mechanism.

Successful exploitation of this vulnerability could allow a remote attacker to execute arbitrary code on the target system.

Unique payloads between the DNS server and our web server will confirm the requests, making this technique very accurate in identifying the vulnerability.

Given the detection mechanism and payload confirmation, there is no room for false positives in this approach.

QID 150440 has been added to the WAS Core Detection Scope, so all scans using the Core detection will include this QID in scanning as well.  However, to expedite testing for CVE-2021-44228 across all of your web applications, it is recommended that you create a new scanning Option Profile to limit testing to only this specific vulnerability.  This can be done by creating a new Option Profile and selecting “Custom Search Lists” under the Detection Scope to create a new static list. 

Complete the creation wizard and add QID 150440 to the Static Search List.

Additionally, we recommend limiting the scan to between 50 and 100 links in scope maximum.

Scanning with this option profile will achieve two things to expedite testing your web applications in the most efficient way possible.  First, we are only testing for one specific vulnerability, QID 150440.  Second, as this vulnerability is only tested at the base URI and several directories up and down as appropriate, there is no need to crawl and test every link in the application.  These two changes will allow each web application to be scanned faster than full Core detection scans while still providing you the necessary visibility of any vulnerable versions of Log4j2.

Уязвимость в Log4j

Эксперты по безопасности
бьют тревогу по поводу новой критической уязвимости, обнаруженной в широко
распространенной библиотеке Apache Log4j. Хакеры уже вовсю пытаются ее эксплуатировать, в
то время как разработчики и специалисты по информбезопасности ищут способы ее
нейтрализовать. Уязвимость, получившая название Log4Shell, уже поставила под угрозу сервисы Apple, Steam, , Tesla, Minecraft и множество других.

Log4j — это Java-библиотека для сбора логов, используемый огромным
количеством различных сетевых сервисов, включая корпоративные и облачные.

Уязвимость в ней,
получившая индекс CVE-2021-44228, позволяет запускать произвольный код без авторизации. Баг был
выявлен экспертами по безопасности AlibabaCloud, и 24 ноября 2021 г. информация о нем была передана
в Apache Foundation.
Проблема затрагивает все версии Log4j с 2.0-beta9 по 2.14.1. Под угрозой — базовые конфигурации ApacheStruts2, Apache Solr, Apache Druid, Apache Flink и др. Большинство их пользователей, по-видимому,
рискуют стать жертвами атак в ближайшее время.

Выявлена новая уязвимость масштабов Shellshock

Уязвимость тривиальна в
эксплуатации: злоумышленнику достаточно заставить приложение отправить в лог
одну строчку кода.

1. Dirty COW

Первой в нашем списке будет свежая уязвимость, которая была обнаружена этой осенью. Название Dirty COW расшифровывается как Copy on Write. Ошибка возникает в файловой системе во время копирования при записи. Это локальная уязвимость, которая позволяет получить полный доступ к системе любому непривилегированному пользователю.

Если коротко, то для использования уязвимости нужно два файла, один доступен на запись только от имени суперпользователя, второй для нас. Начинаем очень много раз записывать данные в наш файл и читать из файла суперпользователя, через определенное время настанет момент, когда буферы обеих файлов смешаются и пользователь сможет записать данные в файл, запись которого ему недоступна, таким образом можно выдать себе права root в системе.

Уязвимость была в ядре около 10 лет, но после обнаружения была быстро устранена, хотя остались еще миллионы устройств Andoid в которых ядро не обновлялось и не думает и где эту уязвимость можно эксплуатировать. Уязвимость получила код CVE-2016-5195.

https://youtube.com/watch?v=b6PGynVqkAY

2021: Обнаружение уязвимости, позволяющей удаленно выполнить произвольный код без аутентификации

Система управления уязвимостями MaxPatrol VM, система глубокого анализа трафика PT Network Attack Discovery и межсетевой экран уровня веб-приложений PT Application Firewall выявляют критически опасную уязвимость нулевого дня в библиотеке журналов Apache Log4j, которую используют миллионы приложений и сервисов на основе Java, корпоративное программное обеспечение и облачные серверы, а также компьютерные игры. Об этом Positive Technologies сообщила 14 декабря 2021 года. С 10 декабря 2021 года злоумышленники активно сканируют сеть в поисках уязвимых систем и атакуют ханипоты.

В одном из самых популярных в мире фреймворков для сбора журналов — библиотеке Log4j разработчика Apache Software Foundation — обнаружена уязвимость нулевого дня. Ей подвержены все версии библиотеки с 2.0-beta9 до 2.14.1. Уязвимость, получившая название Log4Shell, позволяет атакующим удаленно выполнить произвольный код без аутентификации и захватить полный контроль над уязвимыми серверами.

CVE-2021-44228 присвоен максимальный уровень опасности по шкале CVSS 3.0 — 10 баллов. Log4Shell отличает простота эксплуатации: операция по отправке в журнал одной строки кода через приложение не требует от злоумышленников особых технических навыков.

Библиотека Log4j входит в состав большинства сетевых продуктов Apache, а также используется в миллионах корпоративных приложений и веб-сервисов, разработанных на языке Java, для регистрации сообщений об ошибках. По последним данным, уязвимости подвержены облачные серверы Amazon, Apple, Baidu, Cloudflare, DiDi, , JD.com, Microsoft, Minecraft, NetEase, Steam, Tencent, Tesla, , VMware, а также решения тысячи других производителей ПО. Помимо этого, фреймворк активно применяют в различных проектах с открытым исходным кодом, включая Elasticsearch, Ghidra и Red Hat.

Начиная с 10 декабря 2021 года фиксируются попытки массового сканирования сети на предмет уязвимых для Log4Shell систем. Риск ее эксплуатации существенно вырос после того, как на портале GitHub был опубликован первый PoC-эксплойт. По словам экспертов Positive Technologies, в реальных атаках эта уязвимость в Apache Log4j может эксплуатироваться множеством способов, в зависимости от конкретного сервиса. В итоге под угрозой крупные организации по всему миру, сайты правительств, а также большая часть интернета.

Обнаружить киберугрозу помогут продукты Positive Technologies: три из них выявляют уязвимость Log4Shell «из коробки», то есть нынешним пользователям ничего дополнительно загружать не нужно. В частности, если база знаний MaxPatrol VM содержит обновления от 10 декабря 2021 года, уязвимые активы будут выявлены автоматически.

Межсетевой экран уровня веб-приложений PT Application Firewall (версия 3.0) обнаруживает попытку эксплуатации уязвимости как SSTI (внедрение вредоносного кода в шаблон на стороне сервера) и впоследствии блокирует ее, а версия 4.0 дополнительно определяет ее как попытку JNDI-инъекции.

Правило в PT Application Firewall позволяет обнаружить внедрение шаблонов

Эксплуатацию Log4Shell также можно обнаружить с помощью PT NAD во время анализа сетевого трафика. Для этого специалисты экспертного центра безопасности Positive Technologies добавили в продукт специальное правило детектирования.

Срабатывание правила в PT NAD при попытке эксплуатации уязвимости в библиотеке Log4j

What Does that Mean for Elasticsearch? #

All releases of Elasticsearch 5.0 to 7.16.0 are using a vulnerable Log4j2 version — see below for .

But it is not an RCE on Elasticsearch 7.x and 6.x thanks to the Java Security Manager initially introduced with Elasticsearch 2.0 for all distributions. The Security Manager has saved our bacon once again by having a security.policy file that strictly limits and only grants it in a couple of places like Netty, our networking library. Loading data or remote code is not possible from the logging library — which generally makes sense and pays off now.If you want to learn more about this topic, my colleague Alex has written a deep dive into the Java Security Manager.

There is still the potential risk of an information leak through DNS, since this is . However, there are two limitations:

  • The JVM version mitigates the risk since we have been unable to reproduce the leakage on JDK 9 or above that disallows . This assessment still holds even after finding additional attack vectors since the Security Manager cuts off the attacks earlier by never opening an LDAP connection. That applies to clever tricks like omitting the closing brace for both remote and local (on the classpath) variants. See below for .
  • The leak cannot expose the Elasticsearch data but only what is readable through Log4j2 lookups like environment variables and a limited set of environmental data from other sources. Exposing information could be a concern if you set your AWS secrets as an environment variable — which you shouldn’t need on an Elasticsearch server.

Elasticsearch 5.x is susceptible to both RCE and information leak, and you need to urgently work on a mitigation path. Unfortunately, the Security Manager rules for 5.x were as they are since 6.0. For ≥ 5.6.11 you can use as a fix. In earlier versions, you need to remove the class.

The follow-up vulnerabilities number two () and three (), requiring a non-default pattern layout and context lookup, do not apply to Elasticsearch since it doesn’t use such patterns, and Elasticsearch’s own implementation is not affected on the lookup side.

The fourth vulnerability () uses a different attack vector that could apply to Elasticsearch in theory:

  • The attack doesn’t use but interfaces directly with JNDI.
  • It’s not a lookup, so the system property doesn’t apply.
  • The Java Security Manager is installed after Log4j is configured, so it cannot protect you against malicious configurations.

But the precondition is that you can write to configuration files; then, you are already an admin on the system. So this doesn’t add a new attack vector in practice.

Putting all of this information together with a focus on the initial vulnerability (CVE-2021-44228), since the others don’t apply to Elasticsearch. But if you want to get into the clear with your security scanner and team, you will want to update to ≥ 7.16.3 or ≥ 6.8.23 with the fully patched Log4j:

Elasticsearch Log4j JDK1 RCE Leak Action required Protection in place
≥ 7.16.3 2.17.1 any Log4j 2.17.1 and class removed
7.16.2 2.17.0 any Log4j 2.17.0 and class removed
7.16.1 2.11.1 any class removed and
7.0.0 – 7.16.0 2.11.1 ≥ 9 – 2 Java Security Manager and JVM default
7.0.0 – 7.16.0 2.11.1 < 9 Java Security Manager
≥ 6.8.23 2.17.1 any Log4j 2.17.1 and class removed
6.8.22 2.17.0 any Log4j 2.17.0 and class removed
6.8.21 2.11.1 any class removed and
6.4.0 – 6.8.20 2.11.1 ≥ 9 – 2 Java Security Manager and JVM default
6.4.0 – 6.8.20 2.11.1 < 9 Java Security Manager
6.0.0 – 6.3.2 2.9.1 ≥ 9 Java Security Manager and JVM default
6.0.0 – 6.3.2 2.9.1 < 9 Java Security Manager
≥ 5.6.11 2.11.1 any
5.0.0 – 5.6.10 2.6.2 – 2.9.1 any
< 5.0.0 1.x any Log4j 1.x

See 1 See 2 Optionally, for an additional layer of protection.

A final note about using a firewall, only binding to localhost (the default in Elasticsearch), or using an “unknown” endpoint like in Elastic Cloud: This setup will not protect you if your application passes unsanitized strings to Elasticsearch, where those strings could then be logged.

Миллиарды потенциальных целей

По данным Statista.com, объем рынка интернета вещей в 2017 году превысил миллиард долларов. Общее число подключенных к интернету устройств оценивается на текущий момент в 23 с лишним миллиарда с перспективой увеличения до 30 миллиардов к 2020 году. После этого аналитическое агентство IHS Markit прогнозирует нелинейный рост до 125 миллиардов устройств к 2030 году. Такой объем производства вполне возможен, но уже сейчас ударные темпы выпуска IoT-устройств достигаются преимущественно за счет самых дешевых «китайских» девайсов, при разработке которых о безопасности думали в последнюю очередь.

Среди компонентов умного дома и даже охранных систем значительная часть имеет проблемы с безопасностью, причем характерные для целой плеяды устройств, а не просто какой-то одной серии не самого надежного вендора. Речь идет о массовых и грубых нарушениях принципов разработки:

  • использование неизменяемых (hardcoded) и скрытых сервисных учетных данных;
  • применение одинаковых либо легко предсказуемых ключей и ПИН-кодов;
  • отсутствие проверки прав доступа при обращении к известной странице настроек (например, /settings.asp в обход /index.htm) или прямого вызова изображений и видеопотока IP-камеры (вроде /axis-cgi/jpg/image.cgi);
  • некорректная обработка получаемых данных, вызывающая переполнение буфера. Как следствие, возможно выполнение произвольного кода при получении злонамеренно составленного TCP-пакета;
  • принудительное переключение сервера на использование старых версий протоколов по запросу клиентского устройства (я старая глупая железка, давай со мной по-простому);
  • десятки других типовых ошибок и намеренных ослаблений безопасности ради удобства конфигурирования неспециалистами (в том числе — удаленного и без надлежащей авторизации).

Grep / Zgrep — Obfuscated Variants

These commands cover even the obfuscated variants but lack the file name in a match.

This command searches for exploitation attempts in uncompressed files in folder and all sub folders

sudo find /var/log/ -type f -exec sh -c "cat {} | sed -e 's/\${lower://'g | tr -d '}' | egrep -I -i 'jndi:(ldap?|rmi|dns|nis|iiop|corba|nds|http):'" \;

This command searches for exploitation attempts in compressed files in folder and all sub folders

sudo find /var/log/ -name '*.gz' -type f -exec sh -c "zcat {} | sed -e 's/\${lower://'g | tr -d '}' | egrep -i 'jndi:(ldap?|rmi|dns|nis|iiop|corba|nds|http):'" \;

What Should I Do Now? #

To be on the safe side, upgrade to Elasticsearch ≥ 7.16.3 or ≥ 6.8.23. These versions upgraded Log4j to 2.17.0 in 7.16.2 and 6.8.22 and then 2.17.1 in 7.16.3 and 6.8.23. In addition, the to avoid any unnecessary risks around it, which has been very effective against both the initial and the follow-up vulnerabilities (excluding the fourth one). It’s only a few lines in a Gradle build:

If you had already upgraded to Elasticsearch 7.16.1 or 6.8.21, you are also protected against the four vulnerabilities. These versions set in the JVM options and remove the class, which cover the practical vulnerabilities in the context of Elasticsearch; even if your security scanner or team still flags it as an insecure version.

If you cannot upgrade, you should on Elasticsearch ≥ 6.4.0 or ≥ 5.6.11 for an additional layer of protection — below explains why. As soon as possible if you’re using a JDK before 9 — has more details on that. The JVM option protects against remote code execution and information leak in the context of Elasticsearch.

If you cannot upgrade and are using Elasticsearch 5.0.0 – 5.6.10 or 6.0.0 – 6.3.2, you need to . Urgently on 5.x and as soon as possible if you are using 6.x with JDK before 9 — has more details on that. Removing the class protects against remote code execution and information leak in the context of Elasticsearch.

Isn’t the Java Security Manager Deprecated? #

Yes. The Java Security Manager has been deprecated in JDK17 and will be a no-op in JDK18 — for details see JEP 411.

If Log4Shell has shown anything, then it is the value of having a sandbox concept in your application. Why should your logging library be able to make network calls after all? And concepts like SELinux or seccomp are part of the bigger picture but are too blunt for this specific requirement. Here is a Twitter discussion with some people who have spent a lot of time securing Java applications like Elasticsearch.

While we would rather not be in that situation, the Elasticsearch team is already working on new security mechanisms.

How does the Log4Shell vulnerability cause damage?

Because the Log4j 2 library can communicate with other sources and internal directory services, attackers can easily feed Log4j 2 with malicious commands from the outside and make it download and execute dangerous code from malicious sources.

How attackers can exploit Log4j 2 depends on the specifics of the affected system. So far, the vast majority of malicious activity has been mass scanning to fingerprint vulnerable systems. Attackers have been exploiting the vulnerability to compromise virtualization infrastructure, install and execute ransomware, steal system credentials, take broad control of compromised networks, and exfiltrate data, according to a Microsoft report.

As reports continue to mount regarding the exploitability of Log4Shell, the possibilities for malicious activity seem exponential. Malicious actors can execute any code on the attacked system, for example, to access sensitive configuration data. In capturing this data, attackers could gain full control of a system — and all its data and applications. This is like a burglar who has keys to the front door and the combination to the safe inside.

When exactly is the Log4j vulnerability exploitable?

All of the following conditions must apply in order for a specific Java application to be vulnerable:

  • The Java application uses log4j (Maven package log4j-core) version 2.0.0-2.12.1 or 2.13.0-2.14.1

    Version 2.12.2 is not vulnerable, since it received backported fixes from 2.16.0.

  • A remote attacker can cause arbitrary strings to be logged, via one of the logging APIs – , , , , , , . 
  • No Log4j-specific mitigations have been applied (see the next “Mitigations” section).
  • (on some machines) The Java JRE / JDK version in use is older than the following versions:
    • 6u211
    • 7u201
    • 8u191
    • 11.0.1

This is due to the fact that later versions set the JVM property to false by default, which disables JNDI loading of classes from arbitrary URL code bases.Note that relying only on a new Java version as protection against this vulnerability is risky, since the vulnerability may still be exploited on machines that contain certain “gadget” classes in the classpath of the vulnerable application. See – “Exploiting Log4Shell in newer Java versions.”

Am I Vulnerable?

The exploit was quickly patched in ‘s latest release, 2.16.0, but the problem isn’t fixing it—it’s finding out where you need to. Since  is an embedded dependency, it may be non-trivial to search for the specific version of it on your system. And, since Java is so popular, many third-party tools and components may use it, so you may not even know if you are running Java software on your machines.

Advertisement

Even if you think you aren’t vulnerable, you probably still need to double check. This exploit affects so many systems that there is a solid chance you may be running  or Java without realizing it.

Luckily, JDK versions greater than , , , and  are not affected by the primary attack vector (using LDAP) that’s being exploited the most right now. You still need to patch it regardless, since it can easily be used with other attack vectors as well. Also, just the simple act of making a request to an endpoint can reveal data about machines on your network, which isn’t a good thing either.

This exploit highlights why it is important to keep a Software Bill of Materials (SBOM), basically a list of all the software on your systems, where it comes from, and what it’s made from. In the future, this knowledge can help you quickly patch against attacks like this.

In the present, you are probably just concerned about getting your network patched. To do that, you’ll need to scan your systems to find  versions used by your software, and make a list of all the vulnerable components.

Рейтинг
( Пока оценок нет )
Editor
Editor/ автор статьи

Давно интересуюсь темой. Мне нравится писать о том, в чём разбираюсь.

Понравилась статья? Поделиться с друзьями:
3D-тест
Добавить комментарий

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: