-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
in: coreAn issue in spring-security-coreAn issue in spring-security-coretype: bugA general bugA general bugtype: jiraAn issue that was migrated from JIRAAn issue that was migrated from JIRA
Description
Updated
We should provide better error messages when an invalid user format is provided
Original
Henrik Sachse (Migrated from SEC-3204) said:
The org.springframework.security.provisioning.InMemoryUserDetailsManager
may throw a NullPointerException
when an invalid user Properties
file gets loaded (see attachments).
Can be reproduced with the following code having the attached file on the classpath:
String invalidPropertiesFile = "invalid.properties";
ClassPathResource classPathResource = new ClassPathResource(invalidPropertiesFile);
Properties userProperties = new Properties();
userProperties.load(classPathResource.getInputStream());
// NullPointerException thrown here
InMemoryUserDetailsManager inMemoryUserDetailsManager = new InMemoryUserDetailsManager(userProperties);
That is because the method org.springframework.security.core.userdetails.memory.UserAttributeEditor.setAsText(String)
may invoke the java.beans.PropertyEditorSupport.setValue(Object)
method with null
in case its parameter is an empty string.
Metadata
Metadata
Assignees
Labels
in: coreAn issue in spring-security-coreAn issue in spring-security-coretype: bugA general bugA general bugtype: jiraAn issue that was migrated from JIRAAn issue that was migrated from JIRA