Skip to content

[Crash] Unchecked user.loadout.primaryId.length in getUserData #58

@coderabbitai

Description

@coderabbitai

Summary

Services server crashes when user.loadout.primaryId is undefined during account data processing.

Affected Code

server-services/src/data_management/accountManagement.js:99

user.loadout = JSON.parse(user.loadout);
for (var i = 0; i < user.loadout.primaryId.length; i++) {
  // CRASH if user.loadout.primaryId is undefined

Vulnerability

If database contains corrupted loadout JSON or schema mismatch.

Impact

  • Services server crash on user data fetch
  • Denial of service for authentication

Proof of Concept

Corrupt user loadout in DB to missing primaryId field.

Recommended Fix

for (var i = 0; i < (user.loadout?.primaryId?.length || 0); i++) {

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions