You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SECURITY.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,45 @@ When using `om-data-mapper`:
82
82
4. Follow the principle of least privilege when processing untrusted data
83
83
5. Validate and sanitize all input data before mapping
84
84
85
+
### ⚠️ Critical: Dynamic Code Generation Security
86
+
87
+
This library uses dynamic code generation (`new Function()`) for performance optimization. **Mapping configurations MUST come from trusted sources only.**
**Why this matters**: If an attacker can control the mapping configuration, they could inject arbitrary JavaScript code that executes with your application's privileges.
119
+
120
+
**Recommended approach**: Use the Decorator API (`@Mapper`, `@Map`, `@Transform`) which is compile-time safe and provides better performance (112-474% faster).
121
+
122
+
See the class documentation and `docs/DECORATOR_API.md` for more details.
0 commit comments