Skip to content

Commit a2d0dae

Browse files
committed
make logic more resilient against shaded jars
1 parent df73927 commit a2d0dae

File tree

6 files changed

+138
-82
lines changed

6 files changed

+138
-82
lines changed

CHANGELOG.md

+31-26
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
2-
## To Build Or Download Previous Versions
3-
4-
Please see the tags page: https://github.com/mergebase/log4j-detector/tags
5-
6-
## v2021.12.20
7-
8-
- Added support for --stdin, --json, and --exclude options.
9-
- Added support for scanning *.jpi and *.hpi files (essentially zip files).
10-
11-
## v2021.12.17
12-
13-
- Ability to detect log4j-core-2.17.0.jar
14-
15-
## v2021.12.16
16-
17-
- Properly detect exploded Log4J versions (that are not inside *.jar and instead are just sitting as *.class directly on disk).
18-
19-
- Fixed problem that was causing some inner-jar entries to be misread. ("Unexpected end of ZLIB stream").
20-
21-
- All problems now printed on STDERR instead of STDOUT.
22-
23-
- Only check read-permission on files we're interested in (makes for a lot fewer "cannot read!" errors).
24-
25-
26-
1+
2+
## To Build Or Download Previous Versions
3+
4+
Please see the tags page: https://github.com/mergebase/log4j-detector/tags
5+
6+
## v2021.12.22
7+
8+
- Ability to detect log4j-core-2.3.1.jar and log4j-core-2.12.3.jar (both are \_SAFE\_).
9+
- Improved ability to deal with shaded jars.
10+
11+
## v2021.12.20
12+
13+
- Added support for --stdin, --json, and --exclude options.
14+
- Added support for scanning *.jpi and *.hpi files (essentially zip files).
15+
16+
## v2021.12.17
17+
18+
- Ability to detect log4j-core-2.17.0.jar
19+
20+
## v2021.12.16
21+
22+
- Properly detect exploded Log4J versions (that are not inside *.jar and instead are just sitting as *.class directly on disk).
23+
24+
- Fixed problem that was causing some inner-jar entries to be misread. ("Unexpected end of ZLIB stream").
25+
26+
- All problems now printed on STDERR instead of STDOUT.
27+
28+
- Only check read-permission on files we're interested in (makes for a lot fewer "cannot read!" errors).
29+
30+
31+

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ We currently maintain a collection of [log4j-samples](https://github.com/mergeba
3737

3838
# Example Usage: <a name="itemexample"></a>
3939

40-
java -jar log4j-detector-2021.12.20.jar [path-to-scan] > hits.txt
40+
java -jar log4j-detector-2021.12.22.jar [path-to-scan] > hits.txt
4141

4242
![Terminal output from running java -jar log4j-detector.jar in a terminal](./images/log4j-detector.png)
4343

4444
# More Example Usage: <a name="itemmore"></a>
4545

4646
```
47-
java -jar log4j-detector-2021.12.20.jar ./samples
47+
java -jar log4j-detector-2021.12.22.jar ./samples
4848
49-
-- github.com/mergebase/log4j-detector v2021.12.20 (by mergebase.com) analyzing paths (could take a while).
49+
-- github.com/mergebase/log4j-detector v2021.12.22 (by mergebase.com) analyzing paths (could take a while).
5050
-- Note: specify the '--verbose' flag to have every file examined printed to STDERR.
5151
/opt/mergebase/log4j-detector/samples/clt-1.0-SNAPSHOT.jar contains Log4J-2.x >= 2.10.0 _VULNERABLE_
5252
/opt/mergebase/log4j-detector/samples/infinispan-embedded-query-8.2.12.Final.jar contains Log4J-2.x >= 2.0-beta9 (< 2.10.0) _VULNERABLE_
@@ -81,9 +81,9 @@ java -jar log4j-detector-2021.12.20.jar ./samples
8181
# Usage <a name="itemusage"></a>
8282

8383
```
84-
java -jar log4j-detector-2021.12.20.jar
84+
java -jar log4j-detector-2021.12.22.jar
8585
86-
Usage: java -jar log4j-detector-2021.12.20.jar [--verbose] [--json] [--stdin] [--exclude=X] [paths to scan...]
86+
Usage: java -jar log4j-detector-2021.12.22.jar [--verbose] [--json] [--stdin] [--exclude=X] [paths to scan...]
8787
8888
--json - Output STDOUT results in JSON. (Errors/warning still emitted to STDERR)
8989
--stdin - Read STDIN for paths to explore (one path per line)
@@ -95,7 +95,7 @@ Exit codes: 0 = No vulnerable Log4J versions found.
9595
1 = At least one legacy Log4J 1.x version found.
9696
2 = At least one vulnerable Log4J version found.
9797
98-
About - MergeBase log4j detector (version 2021.12.20)
98+
About - MergeBase log4j detector (version 2021.12.22)
9999
Docs - https://github.com/mergebase/log4j-detector
100100
(C) Copyright 2021 Mergebase Software Inc. Licensed to you via GPLv3.
101101
```
@@ -106,7 +106,7 @@ Docs - https://github.com/mergebase/log4j-detector
106106
git clone https://github.com/mergebase/log4j-detector.git
107107
cd log4j-detector/
108108
mvn install
109-
java -jar target/log4j-detector-2021.12.20.jar
109+
java -jar target/log4j-detector-2021.12.22.jar
110110
```
111111
# Testing: <a name="itemtesting"></a>
112112

@@ -169,8 +169,8 @@ to build it, and since this tool has zero dependencies, it shouldn't take too lo
169169
satisfaction. If you don't trust Maven you can go directly into the "src/main/java/com/mergebase/log4j" directory and
170170
type "javac \*.java". That works, too!
171171

172-
We also sign the pre-compiled jar we keep in the root of the repository (./log4j-detector-2021.12.20.jar) with the
173-
MergeBase code signing key. Please run "jarsigner -verbose -verify log4j-detector-2021.12.20.jar" to confirm this.
172+
We also sign the pre-compiled jar we keep in the root of the repository (./log4j-detector-2021.12.22.jar) with the
173+
MergeBase code signing key. Please run "jarsigner -verbose -verify log4j-detector-2021.12.22.jar" to confirm this.
174174

175175
# What Is MergeBase All About? <a name="itemmergebase"></a>
176176

log4j-detector-2021.12.22.jar

58.7 KB
Binary file not shown.

log4j-detector-latest.jar

58.7 KB
Binary file not shown.

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.mergebase</groupId>
77
<artifactId>log4j-detector</artifactId>
8-
<version>2021.12.20</version>
8+
<version>latest</version>
99
<licenses>
1010
<license>
1111
<name>GPL-3.0-only</name>

0 commit comments

Comments
 (0)