Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wrong target branch] #52

Closed
wants to merge 24 commits into from
Closed

Conversation

sahithyandev
Copy link
Collaborator

Previously the user id was passed as a cookie. Due to some security limitations, it wasn't included in subsequent calls. And I couldn't find a quick workaround for it.

I refactored the code to

  • store the user id in chrome.storage.sync
  • use it on subsequent calls

(sendEvent function takes care of these).

@sahithyandev sahithyandev changed the title fix: user id changing everytime for /event [wrong target branch] Aug 14, 2023

export default async function (req: Request, res: Response) {
const userError = (message: string) => {
res.status(400).send(message);

Check warning

Code scanning / CodeQL

Information exposure through a stack trace Medium

This information exposed to the user depends on
stack trace information
.
event,
};

window.postMessage(message, "*");

Check warning

Code scanning / CodeQL

Cross-window communication with unrestricted target origin Medium

Sensitive data
is sent to another window without origin restriction.
mixpanel.track(eventName, { ...others, distinct_id: userId });
}

res.status(200).send(userId);

Check warning

Code scanning / CodeQL

Reflected cross-site scripting Medium

Cross-site scripting vulnerability due to a
user-provided value
.
@sahithyandev sahithyandev deleted the fix/refactor-event-endpoint branch August 14, 2023 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants