7 Commits

Author SHA1 Message Date
Lorenz Junglas
0a7c021079 ! Fix CompilerService attributes based RCE exploit (#4307)
* ! Add tests replicating H1-3601675 attribute RCE

* ! Add tests for potentially dangerous SkipLocalsInit, AsyncMethodBuilder

* ! Blacklist SkipLocalsInit, UnsafeAccessor, AsyncMethodBuilder
2026-03-18 10:00:01 +01:00
Lorenz Junglas
bc36ace71e Fix array pool use after free exploit (#4161)
* ! Reimplement SharedArrayPool because it is internal in .net runtime

* ! Expose PublicArrayPool that maps to our copy of SharedArrayPool

* ! CodeGenerator that remaps System.Buffers.ArrayPool.Shared calls to Sandbox.PublicArrayPool

* ! Don't run ArrayPoolUpgrader in full engine builds

* ! Add tests that verifies ArrayPool.Shared replacements

* ! Remove ArrayPool.Shared from whitelist

* ! Build AST from nodes instead of parsing text

* ! Use Reflection to grab Gen2GcCallback instead of event polling
2026-03-03 19:34:26 +00:00
Sol Williams
45c9cd1aa6 Razor incremental processing + tree reuse (#4139) 2026-02-25 13:11:49 +00:00
Sol Williams
6668270f7b Incremental compiles: smarter processing, syntax tree reuse (#4011)
Avoids unnecessary reparsing and allocations by reusing identical trees, and running generators only on what's been modified, significantly reducing incremental compile times for small changes in large codebases.
2026-02-19 14:29:56 +00:00
Lorenz Junglas
236b95e0ed Disposable diagnostic (#3693)
* Enable CA2000 in editorconfig

* Remove unused CaptureStdOut class

* Add missing dispose calls in Sandbox.Tools

* Add missing dispose calls in tests

* Add missing dispose calls in launchers

* Add missing dispose calls in Topten.RichtTextKit

* Add missing dispose calls in Engine

* Add missing dispose calls in SboxBuild

* Add nullchecks to a few dispose calls

* Fix more missing disposal calls and leaks

* Disable CA2000 for Textures

* Fix disposing too early in ImageFileTextureGenerator

* Fix disposing codec, ownership is transferred to animation

* Add missing using in ByteStream benchmark
2026-01-12 21:59:15 +01:00
Matt Stevens
8c25780848 Fix Compiler.config not being initialized by default
* Extended whitelist tests to use the other method of creating a compiler without explicit compiler settings
* Initialize Compiler._config as it's a struct so everything was zeroed before
2025-12-17 11:07:19 +00:00
s&box team
71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00