Skip to content

Conversation

@boonboonsiri
Copy link
Contributor

@boonboonsiri boonboonsiri commented Dec 12, 2023

}

public generateUUID = (): string => {
return crypto.randomUUID();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to use crypto.randomUUID() but not sure if this is the case but maybe:

parcel-bundler/parcel#8820

Comment on lines +552 to +556
const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (char) => {
const r = Math.random() * 16 | 0;
const v = (char == 'x') ? r : (r & 0x3 | 0x8);
return v.toString(16);
});

Check failure

Code scanning / CodeQL

Insecure randomness

This uses a cryptographically insecure random number generated at [Math.random()](1) in a security context.

// Radar Autocomplete Session
if (this.session) {
const userId = Storage.getItem(Storage.USER_ID) || undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now I'm still including these even though right now we don't use them, but in case we wanted to store them in the future so we don't have to update the sdk twice

@boonboonsiri boonboonsiri requested a review from kochis December 13, 2023 20:00
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