Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2279

Allow SystemPropertiesPropertySource to run with a SecurityManager that rejects system property access

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.10.0
    • Fix Version/s: 2.11.0, 3.0.0
    • Component/s: API
    • Labels:
      None

      Description

      Allow SystemPropertiesPropertySource to run with a SecurityManager that rejects system property access. This is similar to LOG4J2-2274.

      A security manager can blow up an app like this:

      java.lang.ExceptionInInitializerError
      	at org.apache.logging.log4j.util.SystemPropertiesPropertySourceSecurityManagerTest.test(SystemPropertiesPropertySourceSecurityManagerTest.java:64)
      	...
      Caused by: java.lang.SecurityException
      	at org.apache.logging.log4j.util.SystemPropertiesPropertySourceSecurityManagerTest$TestSecurityManager.checkPermission(SystemPropertiesPropertySourceSecurityManagerTest.java:49)
      	at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1265)
      	at java.lang.System.getProperties(System.java:624)
      	at org.apache.logging.log4j.util.SystemPropertiesPropertySource.forEach(SystemPropertiesPropertySource.java:40)
      	at org.apache.logging.log4j.util.PropertiesUtil$Environment.reload(PropertiesUtil.java:330)
      	at org.apache.logging.log4j.util.PropertiesUtil$Environment.<init>(PropertiesUtil.java:322)
      	at org.apache.logging.log4j.util.PropertiesUtil$Environment.<init>(PropertiesUtil.java:310)
      	at org.apache.logging.log4j.util.PropertiesUtil.<init>(PropertiesUtil.java:69)
      	at org.apache.logging.log4j.util.PropertiesUtil.<clinit>(PropertiesUtil.java:49)
      	... 26 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                garydgregory Gary Gregory
                Reporter:
                garydgregory Gary Gregory
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: