@@ -1177,7 +1177,7 @@ export class HelpersModule extends SimpleHelpersModule {
11771177 * e.g. ``const address = `${faker.location.zipCode()} ${faker.location.city()}`;``
11781178 *
11791179 * This method is useful if you have to build a random string from a static, non-executable source
1180- * (e.g. string coming from a user, stored in a database or a file).
1180+ * that you control (e.g. a template authored by a developer or stored in a database or file).
11811181 *
11821182 * It checks the given string for placeholders and replaces them by calling faker methods:
11831183 *
@@ -1200,7 +1200,11 @@ export class HelpersModule extends SimpleHelpersModule {
12001200 * const message = faker.helpers.fake('Your pin is {{string.numeric(4, {"allowLeadingZeros": true})}}.');
12011201 * ```
12021202 *
1203- * It is also NOT possible to use any non-faker methods or plain javascript in such patterns.
1203+ * The pattern is not evaluated as JavaScript: only faker methods can be called, and any
1204+ * parameters are parsed as JSON or plain strings. Nevertheless, it is possible for certain
1205+ * maliciously crafted patterns to use large amounts of memory or CPU time, so the pattern
1206+ * itself must always be from trusted input. Do not evaluate patterns provided by untrusted
1207+ * user input or external sources.
12041208 *
12051209 * @param pattern The pattern string that will get interpolated.
12061210 *
@@ -1226,7 +1230,7 @@ export class HelpersModule extends SimpleHelpersModule {
12261230 * e.g. ``const address = `${faker.location.zipCode()} ${faker.location.city()}`;``
12271231 *
12281232 * This method is useful if you have to build a random string from a static, non-executable source
1229- * (e.g. string coming from a user, stored in a database or a file).
1233+ * that you control (e.g. a template authored by a developer or stored in a database or file).
12301234 *
12311235 * It checks the given string for placeholders and replaces them by calling faker methods:
12321236 *
@@ -1252,7 +1256,11 @@ export class HelpersModule extends SimpleHelpersModule {
12521256 * const message = faker.helpers.fake(['Your pin is {{string.numeric(4, {"allowLeadingZeros": true})}}.']);
12531257 * ```
12541258 *
1255- * It is also NOT possible to use any non-faker methods or plain javascript in such patterns.
1259+ * The pattern is not evaluated as JavaScript: only faker methods can be called, and any
1260+ * parameters are parsed as JSON or plain strings. Nevertheless, it is possible for certain
1261+ * maliciously crafted patterns to use large amounts of memory or CPU time, so the pattern
1262+ * itself must always be from trusted input. Do not evaluate patterns provided by untrusted
1263+ * user input or external sources.
12561264 *
12571265 * @param patterns The array to select a pattern from, that will then get interpolated. Must not be empty.
12581266 *
@@ -1272,7 +1280,7 @@ export class HelpersModule extends SimpleHelpersModule {
12721280 * e.g. ``const address = `${faker.location.zipCode()} ${faker.location.city()}`;``
12731281 *
12741282 * This method is useful if you have to build a random string from a static, non-executable source
1275- * (e.g. string coming from a user, stored in a database or a file).
1283+ * that you control (e.g. a template authored by a developer or stored in a database or file).
12761284 *
12771285 * It checks the given string for placeholders and replaces them by calling faker methods:
12781286 *
@@ -1295,7 +1303,11 @@ export class HelpersModule extends SimpleHelpersModule {
12951303 * const message = faker.helpers.fake('Your pin is {{string.numeric(4, {"allowLeadingZeros": true})}}.');
12961304 * ```
12971305 *
1298- * It is also NOT possible to use any non-faker methods or plain javascript in such patterns.
1306+ * The pattern is not evaluated as JavaScript: only faker methods can be called, and any
1307+ * parameters are parsed as JSON or plain strings. Nevertheless, it is possible for certain
1308+ * maliciously crafted patterns to use large amounts of memory or CPU time, so the pattern
1309+ * itself must always be from trusted input. Do not evaluate patterns provided by untrusted
1310+ * user input or external sources.
12991311 *
13001312 * @param pattern The pattern string that will get interpolated. If an array is passed, a random element will be picked and interpolated.
13011313 *
0 commit comments