GHSA-qxc2-j82w-r537: High severity npm/@faker-js/faker vulnerability

Published Sep 2, 2026
·
Updated

Summary

faker.helpers.fake can be tricked into arbritary code execution.

Details

fakeEval.resolveProperty resolves properties on functions itself instead of resolving the nested function first. This can be addressed by recursively calling resolveProperty instead of accessing the property after one iteration.

PoC

Go to https://fakerjs.dev/ Open Browser console and run

ts await enableFaker(); // or import faker faker.rawDefinitions.test = (() => () => {}); // Any function that returns a function faker.helpers.fake({{test.constructor(alert('PowerLevel: Eval'))}});

Impact

The Fake method claims:

It is also NOT possible to use any non-faker methods or plain javascript in such patterns.

Which is objectively false, since any global gets fully accessible in the fake string.

Affected Software

1 affected componentFixes available
npm/@faker-js/faker<=10.4.0
10.5.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@faker-js/faker to a version that resolves this vulnerability.

    Fixed in 10.5.0

Event History

Sep 2, 2026
Advisory Published
via GitHub·02:20 PM
Data Sourced
via GitHub·02:20 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What conditions are needed to exploit this issue?

Exploitation requires a crafted pattern passed to faker.helpers.fake that reaches function properties during evaluation. The provided proof of concept also registers a definition that returns a function, then uses its constructor property to execute JavaScript.

2

Which applications are realistically exposed?

Applications are exposed when untrusted or attacker-influenced values can become faker.helpers.fake patterns, especially if an attacker can influence Faker raw definitions or other values resolved by those patterns. Uses limited to trusted, static patterns are not shown to be exploitable by the provided proof of concept.

3

What can be done before an update is available?

Do not pass untrusted strings to faker.helpers.fake, and prevent untrusted code or input from modifying faker.rawDefinitions. Restrict fake patterns to controlled static templates until the property-resolution behavior is corrected.

4

How can I check whether my use is affected?

Review calls to faker.helpers.fake for patterns built from request data, configuration controlled by lower-trust users, or other external input. Also review whether faker.rawDefinitions can be modified and whether definitions can return functions that a pattern could traverse.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203