@@ -3010,6 +3010,56 @@ describe('(GHSA-fjxm-vhvc-gcmj) LiveQuery Operator Type Confusion', () => {
30103010 } ) ;
30113011 } ) ;
30123012
3013+ describe ( 'authData dot-notation injection and login crash' , ( ) => {
3014+ it ( 'rejects dotted update key that targets authData sub-field' , async ( ) => {
3015+ const user = new Parse . User ( ) ;
3016+ user . setUsername ( 'dotuser' ) ;
3017+ user . setPassword ( 'pass1234' ) ;
3018+ await user . signUp ( ) ;
3019+
3020+ const res = await request ( {
3021+ method : 'PUT' ,
3022+ url : `http://localhost:8378/1/users/${ user . id } ` ,
3023+ headers : {
3024+ 'Content-Type' : 'application/json' ,
3025+ 'X-Parse-Application-Id' : 'test' ,
3026+ 'X-Parse-REST-API-Key' : 'rest' ,
3027+ 'X-Parse-Session-Token' : user . getSessionToken ( ) ,
3028+ } ,
3029+ body : JSON . stringify ( { 'authData.anonymous".id' : 'injected' } ) ,
3030+ } ) . catch ( e => e ) ;
3031+ expect ( res . status ) . toBe ( 400 ) ;
3032+ } ) ;
3033+
3034+ it ( 'login does not crash when stored authData has unknown provider' , async ( ) => {
3035+ const user = new Parse . User ( ) ;
3036+ user . setUsername ( 'dotuser2' ) ;
3037+ user . setPassword ( 'pass1234' ) ;
3038+ await user . signUp ( ) ;
3039+ await Parse . User . logOut ( ) ;
3040+
3041+ // Inject unknown provider directly in database to simulate corrupted data
3042+ const config = Config . get ( 'test' ) ;
3043+ await config . database . update (
3044+ '_User' ,
3045+ { objectId : user . id } ,
3046+ { authData : { unknown_provider : { id : 'bad' } } }
3047+ ) ;
3048+
3049+ // Login should not crash with 500
3050+ const login = await request ( {
3051+ method : 'GET' ,
3052+ url : `http://localhost:8378/1/login?username=dotuser2&password=pass1234` ,
3053+ headers : {
3054+ 'X-Parse-Application-Id' : 'test' ,
3055+ 'X-Parse-REST-API-Key' : 'rest' ,
3056+ } ,
3057+ } ) . catch ( e => e ) ;
3058+ expect ( login . status ) . toBe ( 200 ) ;
3059+ expect ( login . data . sessionToken ) . toBeDefined ( ) ;
3060+ } ) ;
3061+ } ) ;
3062+
30133063 describe ( '(GHSA-r3xq-68wh-gwvh) Password reset single-use token bypass via concurrent requests' , ( ) => {
30143064 let sendPasswordResetEmail ;
30153065
0 commit comments