Skip to content

Commit 8ffe783

Browse files
kwwalljeremiahjstacey
authored andcommitted
Misc release cleanup (#464)
* Release notes to close issue #463 * Changes to replace deprecated method CryptoHelper.arrayCompare() with MessageDigest.isEqual() which is safe in JDK 7. * Close issue #246 * Close issue #462 * Close issue #364 and general assertion cleanup. * Close issue #417 * Close issue #465 * Add more details, especially regarding dependency updates to address CVEs. * Add WARNINGS to javadoc as noted in comment for GitHub issue #233 * Update OWASP Dependency Check from release 2.1.0 to 4.0.1 (i.e., the latest version). * General clean-up. Add paragraph to discuss CVE-2018-8088 and why ESAPI is not affected. * Update to mention PR #467 and closing of issue #360 * Fix typo in path for configuration/esapi and add 2.2.0.0 release notes. * Change release from 2.1.0.2-SNAPSHOT to 2.2.0.0-SNAPSHOT in prep for release. See GitHub issue #471 * Preparation for 2.2.0.0 release. See GitHub issue #471 for details. * Try to clarify by example the git commands used. * Added Jeremiah's PR #472 * * Reference issue 188 as being closed. * Udate status of latest PRs. * Added 'Basic ESAPI Facts' section.
1 parent c13db6b commit 8ffe783

16 files changed

+548
-71
lines changed

CONTRIBUTING-TO-ESAPI.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,16 @@ Steps to work with ESAPI:
8585
if this is the first time you have run Dependency-Check for ESAPI,
8686
expect it to take a while (often 30 minutes or so!).
8787
7. Commit your changes locally.
88-
8. Push your 'issue-#' branch to your personal, forked ESAPI GitHub repo.-
89-
9. Go to your personal, forked ESAPI GitHub repo and create a
90-
Pull Request from your 'issue-#' branch.
88+
8. Push your 'issue-#' branch to your personal, forked ESAPI GitHub repo. E.g.,
89+
$ git checkout issue-444
90+
$ git remote -v | grep origin # Confirm 'origin' refers to YOUR PERSONAL GitHub repo
91+
$ git push origin issue-444 # Push the committed changes on the 'issue-444' branch
92+
9. Go to your personal, forked ESAPI GitHub repo (web interface) and create a
93+
'Pull Request' from your 'issue-#' branch.
9194
10. Back on your local personal laptop / desktop, merge your issue branch with
92-
your local 'develop' branch.
95+
your local 'develop' branch. I.e.
96+
$ git checkout develop
97+
$ git merge issue-444
9398

9499
In theory, you can do all this 'git' magic from Eclipse and presumably other
95100
IDEs like NetBeans or IntelliJ). From Eclipse, it is right-click on the

configuration/esapi/ESAPI.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ ESAPI.IntrusionDetector=org.owasp.esapi.reference.DefaultIntrusionDetector
7777
# Log4JFactory Requires log4j.xml or log4j.properties in classpath - http://www.laliluna.de/log4j-tutorial.html
7878
ESAPI.Logger=org.owasp.esapi.reference.Log4JLogFactory
7979
#ESAPI.Logger=org.owasp.esapi.reference.JavaLogFactory
80+
# To use the new SLF4J logger in ESAPI (see GitHub issue #129), set
81+
# ESAPI.Logger=org.owasp.esapi.logging.slf4j.Slf4JLogFactory
82+
# and do whatever other normal SLF4J configuration that you normally would do for your application.
8083
ESAPI.Randomizer=org.owasp.esapi.reference.DefaultRandomizer
8184
ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator
8285

-10.1 KB
Binary file not shown.
-567 KB
Binary file not shown.

documentation/esapi4java-2.0-readme.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ File / Directory Descript
1111
|
1212
+---configuration/ Directory of ESAPI configuration files
1313
| |
14-
| |---.esapi/
14+
| |---esapi/
1515
| | |---waf-policies/ Directory containing Web Application Firewall policies
1616
| | |---ESAPI.properties The main ESAPI configuration file
1717
| | `---validation.properties Regular expressions used by the ESAPI validator
@@ -32,6 +32,7 @@ File / Directory Descript
3232
| |---esapi4java-core-2.0-readme-crypto-changes.html Describes why crypto was changed from what was in ESAPI 1.4
3333
| |---esapi4java-core-2.0-symmetric-crypto-user-guide.html User guide for using symmetric encryption in ESAPI 2.0
3434
| |---esapi4java-core-2.1-release-notes.txt ESAPI 2.1 release notes
35+
| |---esapi4java-core-2.2.0.0-release-notes.txt ESAPI 2.2.0.0 release notes
3536
| `---esapi4java-waf-2.0-policy-file-spec.pdf Describes how to configure ESAPI 2.0's Web Application Firewall
3637
|
3738
|---libs/ ESAPI dependencies
@@ -57,4 +58,4 @@ notes.
5758
Please address comments and questions concerning the API and this document to
5859
the ESAPI Users mailing list, <[email protected]>.
5960

60-
Copyright (C) 2009-2010 The OWASP Foundation.
61+
Copyright (C) 2009-2019 The OWASP Foundation.

documentation/esapi4java-core-2.2.0.0-release-notes.txt

Lines changed: 361 additions & 0 deletions
Large diffs are not rendered by default.

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.owasp.esapi</groupId>
55
<artifactId>esapi</artifactId>
6-
<version>2.1.0.2-SNAPSHOT</version>
6+
<version>2.2.0.0-SNAPSHOT</version>
77
<packaging>jar</packaging>
88

99
<prerequisites>
@@ -369,7 +369,7 @@
369369
<plugin>
370370
<groupId>org.owasp</groupId>
371371
<artifactId>dependency-check-maven</artifactId>
372-
<version>2.1.0</version>
372+
<version>4.0.1</version>
373373
<configuration>
374374
<!-- <failBuildOnCVSS>5.9</failBuildOnCVSS> -->
375375
<suppressionFile>./suppressions.xml</suppressionFile>

src/main/java/org/owasp/esapi/Authenticator.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ public interface Authenticator {
111111

112112
/**
113113
* Verify that the supplied password matches the password for this user. Password should
114-
* be stored as a hash. It is recommended you use the hashPassword(password, accountName) method
115-
* in this class.
114+
* be stored as a hash. By default, this method verifies password hashes created via the
115+
* {@code hashPassword(password, accountName)} method in this class, however see WARNING
116+
* the {@code hashPassword} method.
117+
* <p>
116118
* This method is typically used for "reauthentication" for the most sensitive functions, such
117119
* as transactions, changing email address, and changing other account information.
118120
*
@@ -123,6 +125,8 @@ public interface Authenticator {
123125
*
124126
* @return
125127
* true, if the password is correct for the specified user
128+
*
129+
* @see #hashPassword(String password, String accountName)
126130
*/
127131
boolean verifyPassword(User user, String password);
128132

@@ -141,6 +145,13 @@ public interface Authenticator {
141145
* Two copies of the new password are required to encourage user interface designers to
142146
* include a "re-type password" field in their forms. Implementations should verify that
143147
* both are the same.
148+
* <p>
149+
* <b>WARNING:</b> The implementation of this method as defined in the
150+
* default reference implementation class, {@code FileBasedAuthenticator},
151+
* uses a password hash algorthim that is known to be weak. You are advised
152+
* to replace the default reference implementation class with your own custom
153+
* implementation that uses a stronger password hashing algorithm.
154+
* See class comments in * {@code FileBasedAuthenticator} for further details.
144155
*
145156
* @param accountName
146157
* the account name of the new user
@@ -257,6 +268,13 @@ public interface Authenticator {
257268
* This method specifies the use of the user's account name as the "salt"
258269
* value. The Encryptor.hash method can be used if a different salt is
259270
* required.
271+
* <p>
272+
* <b>WARNING:</b> The implementation of this method as defined in the
273+
* default reference implementation class, {@code FileBasedAuthenticator},
274+
* is know to be extremely weak. The reference implementation class was
275+
* meant to be an example implementation and generally should be avoided
276+
* and replaced with your own implementation. See class comments in
277+
* {@code FileBasedAuthenticator} for further details.
260278
*
261279
* @param password
262280
* the password to hash
@@ -266,6 +284,9 @@ public interface Authenticator {
266284
* @return
267285
* the hashed password
268286
* @throws EncryptionException
287+
*
288+
* @see org.owasp.esapi.reference.FileBasedAuthenticator FileBasedAuthenticator,
289+
* the default reference implementation of this interface.
269290
*/
270291
String hashPassword(String password, String accountName) throws EncryptionException;
271292

src/main/java/org/owasp/esapi/crypto/CipherSpec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ public boolean equals(Object other) {
350350
NullSafe.equals(this.cipher_xform_, that.cipher_xform_) &&
351351
this.keySize_ == that.keySize_ &&
352352
this.blockSize_ == that.blockSize_ &&
353-
// Comparison safe from timing attacks.
354-
CryptoHelper.arrayCompare(this.iv_, that.iv_) );
353+
// In all versions of JDK 7 and later, comparison safe from timing attacks.
354+
java.security.MessageDigest.isEqual(this.iv_, that.iv_) );
355355
}
356356
return result;
357357
}

src/main/java/org/owasp/esapi/crypto/CipherText.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public boolean validateMAC(SecretKey authKey) {
470470
"computed MAC len: " + mac.length +
471471
", received MAC len: " + separate_mac_.length);
472472
}
473-
return CryptoHelper.arrayCompare(mac, separate_mac_); // Safe compare!!!
473+
return java.security.MessageDigest.isEqual(mac, separate_mac_); // Safe compare in JDK 7 and later
474474
} else if ( ! requiresMAC ) { // Doesn't require a MAC
475475
return true;
476476
} else {
@@ -712,8 +712,8 @@ public String toString() {
712712
result = (that.canEqual(this) &&
713713
this.cipherSpec_.equals(that.cipherSpec_) &&
714714
// Safe comparison, resistant to timing attacks
715-
CryptoHelper.arrayCompare(this.raw_ciphertext_, that.raw_ciphertext_) &&
716-
CryptoHelper.arrayCompare(this.separate_mac_, that.separate_mac_) &&
715+
java.security.MessageDigest.isEqual(this.raw_ciphertext_, that.raw_ciphertext_) &&
716+
java.security.MessageDigest.isEqual(this.separate_mac_, that.separate_mac_) &&
717717
this.encryption_timestamp_ == that.encryption_timestamp_ );
718718
} else {
719719
logger.warning(Logger.EVENT_FAILURE, "CipherText.equals(): Cannot compare two " +

0 commit comments

Comments
 (0)