Skip to content

[Crash] Unchecked user.loadout.secondaryId.length in getUserData #59

@coderabbitai

Description

@coderabbitai

Summary

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

Affected Code

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

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

Vulnerability

If database contains corrupted loadout JSON.

Impact

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

Recommended Fix

for (var i = 0; i < (user.loadout?.secondaryId?.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