Skip to content

Commit 34c4e1a

Browse files
authored
Added security section under challenges (#1554)
1 parent cba62ff commit 34c4e1a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

working/static metaprogramming/intro.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,24 @@ A Turing-complete programming language that runs in your typechecker opens the
425425
door to user-code that locks the IDE. How do we ensure that users maintain a
426426
fast edit refresh cycle when arbitrary Dart code may be running during compilation?
427427

428+
### Security
429+
430+
Today, users are fully aware of exactly when third party code (excluding code
431+
from the sdk) might be executed (only when they explicitly run a program). This
432+
will change with this proposal, since it involves running user code as a part
433+
of the compilation and likely program analysis process. This means that even
434+
opening your IDE for instance could expose you to malicious code if we aren't
435+
careful.
436+
437+
In order to minimize the threat of malicious code which could run in these
438+
contexts, we will likely need to limit the read/write/execution access of
439+
macro code, including access to ffi or other libraries which might enable that
440+
same access.
441+
442+
One possible way to do this would to be to explicitly limit the `dart:`
443+
libraries that are available for use at compile time.
444+
445+
428446
[function_builders]: https://github.com/apple/swift-evolution/blob/9992cf3c11c2d5e0ea20bee98657d93902d5b174/proposals/XXXX-function-builders.md
429447
[zig_compile_time_execution]: https://andrewkelley.me/post/zig-programming-language-blurs-line-compile-time-run-time.html#:~:text=Compile%2DTime%20Parameters,-Compile%2Dtime%20parameters&text=In%20Zig%2C%20types%20are%20first,functions%2C%20and%20returned%20from%20functions.&text=At%20the%20callsite%2C%20the%20value,is%20known%20at%20compile%2Dtime.
430448
[data_classes_issue]: https://github.com/dart-lang/language/issues/314

0 commit comments

Comments
 (0)