Skip to content

crypto.getRandomValues returns undefined in Chromium 23 #9250

Closed
@jghinestrosa

Description

@jghinestrosa

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

7.73.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

Call Sentry.captureException

Expected Result

Exception to be reported to Sentry

Actual Result

crypto.getRandomValues returns undefined, hence

getRandomByte = () => crypto.getRandomValues(new Uint8Array(1))[0];

throws an error:

TypeError: Cannot read properties of undefined (reading '0')

This is something I already tracked in other closed issues like:

I'm aware in those cases it looked like it was due to a polyfill implementation issues. Besides, the sentry package that was provided in the issue was @sentry/node.

However in this case, I noticed this issue by using @sentry/browser in an old Chromium version: 23.0.1235.0 (151422).

In fact, just executing crypto.getRandomValues(new Uint8Array(1)) in Chrome DevTools console, it returns undefined.

get-random-values-returns-undefined

The typed array is updated anyways, the only problem is this particular implementation of getRandomValues doesn't return the typed array:

typed-array-updated

I think it might be possible that other old browser engines and versions are affected by this issue but, unfortunately, I have not been able to check it yet.

Metadata

Metadata

Assignees

Labels

Package: browserIssues related to the Sentry Browser SDK

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions