Source:
<code>public void scanHttpResponseReceive(HttpMessage msg, int id, Source source) { TreeSet<HtmlParameter> urlParams = msg.getUrlParams(); String uri = msg.getRequestHeader().getURI().toString(); boolean found = false; OptionsParam options = Model.getSingleton().getOptionsParam(); HttpSessionsParam sessionOptions = options.getParamSet(HttpSessionsParam.class); if(!urlParams.isEmpty() && sessionOptions != null) { List<String> sessionIds = sessionOptions.getDefaultTokensEnabled(); for (HtmlParameter param: urlParams) { if (sessionIds.contains(param.getName().toLowerCase(Locale.ROOT))) { if (param.getValue().length() > SESSION_TOKEN_MIN_LENGTH) { Alert alert = new Alert(getPluginId(), getRisk(), Alert.CONFIDENCE_HIGH, getName()); alert.setDetail( getDescription(), uri, param.getName(), "", "", getSolution(), getReference(), param.getValue(), getCweId(), getWascId(), msg); parent.raiseAlert(id, alert); found = true; } } } } if (!found) { <START> Matcher jsessMatcher = Pattern.compile(";jsessionid\\=[\\dA-Z]*", Pattern.CASE_INSENSITIVE).matcher(uri); <END> if (jsessMatcher.find()) { Alert alert = new Alert(getPluginId(), getRisk(), Alert.CONFIDENCE_HIGH, getName()); alert.setDetail( getDescription(), uri, "", "", "", getSolution(), getReference(), jsessMatcher.group(), getCweId(), getWascId(), msg); parent.raiseAlert(id, alert); found = true; } } try { checkSessionIDExposure(msg, id); } catch (URIException e) { } }</code><technical_language>equal need escaped. - check path component (it null though). - if name is extracted compared session names</technical_language>

Target:
public void scanHttpResponseReceive(HttpMessage msg, int id, Source source) { TreeSet<HtmlParameter> urlParams = msg.getUrlParams(); String uri = msg.getRequestHeader().getURI().toString(); boolean found = false; OptionsParam options = Model.getSingleton().getOptionsParam(); HttpSessionsParam sessionOptions = options.getParamSet(HttpSessionsParam.class); List<String> sessionIds = Collections.emptyList(); if (sessionOptions != null) { sessionIds = sessionOptions.getDefaultTokensEnabled(); } if(!urlParams.isEmpty()) { for (HtmlParameter param: urlParams) { if (sessionIds.contains(param.getName().toLowerCase(Locale.ROOT))) { if (param.getValue().length() > SESSION_TOKEN_MIN_LENGTH) { Alert alert = new Alert(getPluginId(), getRisk(), Alert.CONFIDENCE_HIGH, getName()); alert.setDetail( getDescription(), uri, param.getName(), "", "", getSolution(), getReference(), param.getValue(), getCweId(), getWascId(), msg); parent.raiseAlert(id, alert); found = true; } } } } if (!found && msg.getRequestHeader().getURI().getEscapedPath() != null) { Matcher jsessMatcher = null; try { jsessMatcher = Pattern.compile("jsessionid=[\\dA-Z]*", Pattern.CASE_INSENSITIVE).matcher(msg.getRequestHeader().getURI().getPath()); } catch (URIException e) { } if (jsessMatcher != null && jsessMatcher.find() && sessionIds.contains(jsessMatcher.group().split("=")[0].trim())) { Alert alert = new Alert(getPluginId(), getRisk(), Alert.CONFIDENCE_HIGH, getName()); alert.setDetail( getDescription(), uri, "", "", "", getSolution(), getReference(), jsessMatcher.group(), getCweId(), getWascId(), msg); parent.raiseAlert(id, alert); found = true; } } if (found) { try { checkSessionIDExposure(msg, id); } catch (URIException e) { } } }