Headline
CVE-2020-36635: RA-1772: Fix stored xss is appointment scheduling (#32) · openmrs/openmrs-module-appointmentscheduling@34213c3
A vulnerability was found in OpenMRS Appointment Scheduling Module up to 1.12.x. It has been classified as problematic. This affects the function validateFieldName of the file api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java. The manipulation leads to cross site scripting. It is possible to initiate the attack remotely. Upgrading to version 1.13.0 is able to address this issue. The name of the patch is 34213c3f6ea22df427573076fb62744694f601d8. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-216915.
@@ -18,6 +18,7 @@ import org.openmrs.annotation.Handler; import org.openmrs.module.appointmentscheduling.AppointmentType; import org.openmrs.module.appointmentscheduling.api.AppointmentService; import org.openmrs.web.WebUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.validation.Errors; @@ -82,6 +83,9 @@ private void validateFieldName(Errors errors, AppointmentType appointmentType) { if (verifyIfNameHasMoreThan100Characters(appointmentType.getName())) { errors.rejectValue("name", “appointmentscheduling.AppointmentType.longName.errorMessage”); } if(verifyIfNameHasHtmlEncodableChars(appointmentType.getName())){ errors.rejectValue("name", “appointmentscheduling.AppointmentType.unsafeName.errorMessage”); } }
private boolean verifyIfNameHasMoreThan100Characters(String appointmentName) { @@ -110,5 +114,12 @@ private boolean verifyIfDescriptionHasMoreThan1024Characters(String description) } return false; }
private boolean verifyIfNameHasHtmlEncodableChars(String appointmentName) { if(appointmentName != null){ return !WebUtil.escapeHTML(appointmentName).equals(appointmentName); } return false; }
}