Skip to content

Commit 77ce565

Browse files
committed
authhelper: Sync collections to address concurrency issues
Signed-off-by: kingthorin <[email protected]>
1 parent bbf8553 commit 77ce565

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

addOns/authhelper/src/main/java/org/zaproxy/addon/authhelper/AuthUtils.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,23 @@ public class AuthUtils {
168168
* session management to auto-detect, setting the checking strategy to "poll" but not specified
169169
* a URL.
170170
*/
171-
private static Map<Integer, VerificationRequestDetails> contextVerifMap = new HashMap<>();
171+
private static Map<Integer, VerificationRequestDetails> contextVerifMap =
172+
Collections.synchronizedMap(new HashMap<>());
172173

173174
/**
174175
* The best session management request we have found for a context. There will only be a
175176
* verification request recorded if the user has indicated that they want ZAP to auto-detect one
176177
* by setting session management to auto-detect.
177178
*/
178179
private static Map<Integer, SessionManagementRequestDetails> contextSessionMgmtMap =
179-
new HashMap<>();
180+
Collections.synchronizedMap(new HashMap<>());
180181

181182
/**
182183
* The URLs (and methods) we've checked for finding good verification requests. These will only
183184
* be recorded if the user has set verification to auto-detect.
184185
*/
185-
private static Map<Integer, Set<String>> contextVerificationMap = new HashMap<>();
186+
private static Map<Integer, Set<String>> contextVerificationMap =
187+
Collections.synchronizedMap(new HashMap<>());
186188

187189
public static long getTimeToWaitMs() {
188190
return timeToWaitMs;

addOns/automation/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1212

1313
### Fixed
1414
- Address exception when loading Client Script authentication method.
15+
- Changes to address concurrent modification exceptions.
1516

1617
## [0.48.0] - 2025-03-04
1718
### Changed

0 commit comments

Comments
 (0)