Apache Logging Services (2024)

If you have encountered an unlisted security vulnerability or other unexpected behaviour that has a security impact, or if the descriptions here are incomplete, please report them privately to the Logging Services Security Team.

Important

We urge you to carefully read the threat model detailed in following sections before submitting a report.It guides users on certain safety instructions while using Logging Services software and elaborates on what counts as an unexpected behaviour that has a security impact.

Common threat model

Below we share the threat model shared by all Logging Services projects.

Code signing

All Logging Services software release distributions are signed using GPG using a key from the Logging Services PMC KEYS file.Information on how to verify releases signatures are explained further in the Download page.Thus, GPG signatures should be validated in your build process.

Configuration sources

All configuration sources to an application must be trusted by the programmer.When loading a configuration file from disk (especially when a monitor interval is configured to reload the file periodically), the location of the configuration file must be kept safe from unauthorized modifications.Similarly, when loading a configuration file over the network such as through HTTP, this should be configured to use TLS or a secure connection in general with strong authentication guarantees.This remote location must be kept safe from unauthorized modifications.

For Java-based projects supporting JNDI or JMX,when configurations are modified through JMX, the JMX server should be safely configured to require authentication and a secure connection if being accessed over the network.When configurations are provided through JNDI, these should only use the java scheme for sharing configurations in a Java EE or Jakarta EE application service.JNDI-sourced configurations should not use other JNDI providers such as LDAP, DNS, or RMI, as all these providers are difficult to properly secure.

Log4j threat model

Below we share the threat model specific to Log4j.

Parameterized logging

When using a log message containing template parameters like {}, only the format string is evaluated for parameters to be substituted.The message parameters themselves are not evaluated for parameters; they are only included in the format string corresponding to their template position.The conversion of message parameters into a string is done on-demand depending on the layout being used.When structure-preserving transformations of log message data are required, the Message API should be used for logging structured data combined with a structured layout (e.g., JsonTemplateLayout).Format strings should be compile-time constants, and under no circ*mstances should format strings be built using user-controlled input data.

Unstructured logging

When using an unstructured layout such as PatternLayout, no guarantees can be made about the output format.This layout is mainly useful for development purposes and should not be relied on in production applications.For example, if a log message contains new lines, these are not escaped or encoded specially unless the configured pattern uses the %encode{pattern}{CRLF} wrapper pattern converter (which will encode a carriage return as the string \r and a line feed as the string \n) or some other %encode option.Note that %xEx is appended to the pattern unless already present.Similarly, other encoding options are available for other formats, but pattern layouts cannot make assumptions about the entire output.As such, when using unstructured layouts, no user-controlled input should be included in logs.It is strongly recommended that a structured layout (e.g., JsonTemplateLayout) is used instead for these situations.Note that StrLookup plugins (those referenced by ${…​} templates in configuration files) that contain user-provided input should not be referenced by layouts.

Structured logging

When using a structured layout (most layouts besides pattern layout), log messages are encoded according to various output formats.These safely encode the various fields included in a log message.For example, the JsonTemplateLayout can be configured to output log messages in various JSON structures where all log data is properly encoded into safely parseable JSON.This is the recommended mode of operation for use with log parsing and log collection tools that rely on log files or arbitrary output streams.

Java Security Manager

Log4j 3 no longer supports running in or using a custom SecurityManager.This Java feature has been deprecated for removal in Java 21.Log4j 2 includes partial support for running with a Security Manager.

Log masking

Log4j, like any other generic logging library, cannot generically support log masking of sensitive data.While custom plugins may be developed to attempt to mask various regular expressions (such as a string that looks like a credit card number), the general problem of log masking is equivalent to the halting problem in computer science where sensitive data can always be obfuscated in such a way as to avoid detection by log masking.As such, it is the responsibility of the developer to properly demarcate sensitive data such that it can be consistently masked by log masking plugins.This sort of use case should make use of the Message API for better control over the output of such data.

Availability

Log4j goes to great lengths to minimize performance overhead along with options for minimizing latency or maximizing throughput.However, we cannot guarantee availability of the application if the appenders cannot keep up with the logs being written.Synchronous logging can cause applications to block and wait for a log message to be written.Asynchronous logging can also cause applications to block and wait depending on the wait strategy and queue full policy configured.Configuring too large or too many buffers in an application can also result in out of memory errors.

Compressing logs

If log compression is used along with custom encryption where logs contain user-controlled input, then this can lead to a CRIME attack style vulnerability where a chosen-plaintext attack is combined with information leakage caused by how the compression algorithm handles different inputs.The simplest way to avoid this problem is to never combine compression with encryption when encoding user-controlled input.

Log4Net threat model

Below we share the threat model specific to log4net.

Parameterized logging

When using a log message containing template parameters like {0}, only the format string is evaluated for parameters to be substituted.The message parameters themselves are not evaluated for parameters; they are only included in the format string corresponding to their template position.The conversion of message parameters into a string is done on-demand depending on the layout being used.When structure-preserving transformations of log data are required, a structured layout (e.g., XmlLayout) should be used.Format strings should be compile-time constants, and under no circ*mstances should format strings be built using user-controlled input data.

Unstructured logging

When using an unstructured layout such as PatternLayout, no guarantees can be made about the output format.This layout is mainly useful for development purposes and should not be relied on in production applications.For example, if a log message contains new lines, these are not escaped or encoded.As such, when using unstructured layouts, no user-controlled input should be included in logs.It is strongly recommended that a structured layout (e.g., XmlLayout) is used instead for these situations.

Structured logging

When using a structured layout (most layouts besides pattern layout), log messages are encoded according to various output formats.These safely encode the various fields included in a log message.For example, the XmlLayout can be used to output log messages in an XML structure where all log data is properly encoded into safely parseable XML.This is the recommended mode of operation for use with log parsing and log collection tools that rely on log files or arbitrary output streams.

Log masking

Log4Net, like any other generic logging library, cannot generically support log masking of sensitive data.While custom plugins may be developed to attempt to mask various regular expressions (such as a string that looks like a credit card number), the general problem of log masking is equivalent to the halting problem in computer science where sensitive data can always be obfuscated in such a way as to avoid detection by log masking.As such, it is the responsibility of the developer to properly demarcate sensitive data such that it can be consistently masked by log masking plugins.

Availability

Log4Net goes to great lengths to minimize performance overhead along with options for minimizing latency or maximizing throughput.However, we cannot guarantee availability of the application if the appenders cannot keep up with the logs being written.Logging can cause applications to block and wait for a log message to be written.

Apache Logging Services (2024)
Top Articles
What to Sell on Etsy | Explore Top Selling Items on Etsy 2022
Stock Buybacks Hurt Workers
Bank Of America Financial Center Irvington Photos
Sound Of Freedom Showtimes Near Governor's Crossing Stadium 14
Robinhood Turbotax Discount 2023
Bank Of America Appointments Near Me
Mr Tire Rockland Maine
Riegler & Partner Holding GmbH auf LinkedIn: Wie schätzen Sie die Entwicklung der Wohnraumschaffung und Bauwirtschaft…
Weapons Storehouse Nyt Crossword
Nyuonsite
Catsweb Tx State
Zoebaby222
Newgate Honda
C-Date im Test 2023 – Kosten, Erfahrungen & Funktionsweise
Rosemary Beach, Panama City Beach, FL Real Estate & Homes for Sale | realtor.com®
Sivir Urf Runes
Buff Cookie Only Fans
7 Fly Traps For Effective Pest Control
Is Grande Internet Down In My Area
Craigslist Free Stuff Merced Ca
Prestige Home Designs By American Furniture Galleries
Sizewise Stat Login
Busted Newspaper Fauquier County Va
Wsop Hunters Club
Free Personals Like Craigslist Nh
Red8 Data Entry Job
25 Best Things to Do in Palermo, Sicily (Italy)
Play Tetris Mind Bender
Divide Fusion Stretch Hoodie Daunenjacke für Herren | oliv
Lacey Costco Gas Price
Gillette Craigslist
Bolly2Tolly Maari 2
Best Restaurants Ventnor
O'reilly Auto Parts Ozark Distribution Center Stockton Photos
What Is Xfinity and How Is It Different from Comcast?
Rise Meadville Reviews
Craigslist Summersville West Virginia
Henry County Illuminate
Seminary.churchofjesuschrist.org
Doublelist Paducah Ky
Memberweb Bw
8776725837
60 Days From May 31
Strange World Showtimes Near Century Stadium 25 And Xd
Studentvue Calexico
Unblocked Games - Gun Mayhem
The Blackening Showtimes Near Ncg Cinema - Grand Blanc Trillium
Take Me To The Closest Ups
Urban Airship Acquires Accengage, Extending Its Worldwide Leadership With Unmatched Presence Across Europe
2000 Fortnite Symbols
Divisadero Florist
Craigslist Centre Alabama
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 5711

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.