SAP Knowledge Base Article - Public

2800213 - Java exception when slash and backslash passed in OData API call url

Symptom

Java exception occurs when component ID has special characters (either '/'  or '\' is causing the issue) e.g. "//A-10001-01002" https://XXXX-stage.plateau.com/learning/odatav4/public/user/learningPlan/v1/LearningItemDetails( '//A-10001-01002-COURSE-1551096000000')/scheduledofferings

Error: 500 HTTP error returned: Error message = javax.servlet.ServletException: The key value is not valid.

Environment

SuccessFactors Learning Management System (LMS)

Reproducing the Issue

Create an item with forwardslash ("/") or backslash ("\") in the itemID and call this ID in any of LMS OData API get calls (within the url request)

Cause

Special characters forwardslash ("/") or backslash ("\") are not supported in LMS OData API. The reason being there's too much risk for path manipulation or directory traversal attack.

Resolution

If you are planning on utilising our OData API refrain from creating learning/student components with these characters in their IDs.

Keywords

SuccessFactors, SAP, Learning, LMS, Learning Management System, Learning OData API, OData API, special characters, backslash, forwardslash, 500 error, The key value is not valid , KBA , LOD-SF-LMS-ODA , LMS Web Services OData , LOD-SF-LMS , SuccessFactors Learning , Problem

Product

SAP SuccessFactors Learning 1511 ; SAP SuccessFactors Learning 1602 ; SAP SuccessFactors Learning 1605 ; SAP SuccessFactors Learning 1608 ; SAP SuccessFactors Learning 1611 ; SAP SuccessFactors Learning 1702 ; SAP SuccessFactors Learning 1705 ; SAP SuccessFactors Learning 1708 ; SAP SuccessFactors Learning 1711 ; SAP SuccessFactors Learning 1802 ; SAP SuccessFactors Learning 1805 ; SAP SuccessFactors Learning 1808 ; SAP SuccessFactors Learning 1811 ; SAP SuccessFactors Learning 1902 ; SUCCESSFACTORS LEARNING 1905 ; SUCCESSFACTORS LEARNING 1908 ; SuccessFactors Learning 1207 ; SuccessFactors Learning 1210 ; SuccessFactors Learning 1302 ; SuccessFactors Learning 1305 ; SuccessFactors Learning 1308 ; SuccessFactors Learning 1311 ; SuccessFactors Learning 1402 ; SuccessFactors Learning 1405 ; SuccessFactors Learning 1408 ; SuccessFactors Learning 1411 ; SuccessFactors Learning 1502 ; SuccessFactors Learning 1505 ; SuccessFactors Learning 1508