Guest User

S&Box Editor WhiteList

a guest
May 12th, 2026
57
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.72 KB | Gaming | 0 0
  1. Here's what the whitelist system actually blocks, based on reading the source directly: ((ACCORDING TO A CLAUDE CODE W SOURCE ACCESS)
  2.  
  3. ---
  4. Two-Phase Enforcement
  5.  
  6. Phase 1 — Compile-time Blacklist (BlacklistCodeWalker.cs, error SB500)
  7.  
  8. Walks Roslyn syntax trees and blocks these by name, regardless of whether you call them directly:
  9.  
  10. - System.Runtime.CompilerServices.Unsafe.* — all unsafe ops
  11. - MemoryMarshal.CreateReadOnlySpan*
  12. - Attributes: InlineArrayAttribute, SkipLocalsInitAttribute (uninitialized stack read), UnsafeAccessorAttribute,
  13. UnsafeAccessorTypeAttribute, AsyncMethodBuilderAttribute (the last three are flagged as RCE vectors in comments)
  14.  
  15. Phase 2 — IL Whitelist (AssemblyAccess.cs, error SB1000)
  16.  
  17. After Roslyn emits IL, Mono.Cecil walks every instruction and type reference. If it's not explicitly whitelisted, the
  18. assembly is rejected. This also catches compiler-generated code the user didn't write directly.
  19.  
  20. ---
  21. What's Blocked (Notable Items)
  22.  
  23. What: FileStream, File, Directory, DirectoryInfo
  24. Why: Not in whitelist — no direct filesystem access
  25. ────────────────────────────────────────
  26. What: StreamReader(string path)
  27. Why: Only the Stream-based constructor is whitelisted
  28. ────────────────────────────────────────
  29. What: Path.GetFullPath, Path.GetTempPath, Path.Exists
  30. Why: Explicitly !-excluded from an otherwise-allowed Path.* rule
  31. ────────────────────────────────────────
  32. What: Process, Environment.Exit, most of Environment
  33. Why: Not in whitelist (only StackTrace and CurrentManagedThreadId are)
  34. ────────────────────────────────────────
  35. What: Thread, ThreadPool, Mutex
  36. Why: Not in whitelist (only Interlocked, Monitor.Enter/Exit, SemaphoreSlim, CancellationToken, Channels)
  37. ────────────────────────────────────────
  38. What: MethodInfo.Invoke, PropertyInfo.GetValue, Type.GetMethods()
  39. Why: Reflection is whitelisted only for metadata reading, not invocation
  40. ────────────────────────────────────────
  41. What: Activator.CreateInstance<T>() with type parameters
  42. Why: Only the generic parameterless form is allowed
  43. ────────────────────────────────────────
  44. What: P/Invoke / DllImport
  45. Why: DllImportAttribute not in whitelist; any native method triggers it
  46. ────────────────────────────────────────
  47. What: fixed (pinned vars)
  48. Why: Triggers UnverifiableCodeAttribute → blocked
  49. ────────────────────────────────────────
  50. What: Explicit struct layout
  51. Why: StructLayoutAttribute not in whitelist
  52. ────────────────────────────────────────
  53. What: Marshal / MarshalAs / FieldOffset
  54. Why: Not in whitelist
  55. ────────────────────────────────────────
  56. What: MemberwiseClone, Array.Clone
  57. Why: Explicitly !-excluded from otherwise-allowed Object.* / Array.*
  58. ────────────────────────────────────────
  59. What: ArrayPool.Shared
  60. Why: Explicitly !-excluded — user must create their own pool
  61. ────────────────────────────────────────
  62. What: Getting a delegate to a finalizer
  63. Why: IL-level check: ldftn/ldvirtftn of Finalize is blocked
  64. ────────────────────────────────────────
  65. What: Delegate constructors / CreateDelegate
  66. Why: Not whitelisted (only Combine/Remove/GetInvocationList/DynamicInvoke are)
  67. ────────────────────────────────────────
  68. What: GC.* except SuppressFinalize
  69. Why: Not in whitelist
  70. ────────────────────────────────────────
  71. What: DataAnnotations.CompareAttribute
  72. Why: Specifically excluded with a comment: "magic sauce that allows a property access"
  73. ────────────────────────────────────────
  74. What: Any assembly not in the allowed list
  75. Why: Entire assemblies like System.Diagnostics.Process, System.Net.Sockets, etc. can't be referenced at all
  76.  
  77. ---
  78. What's Allowed (Key Highlights)
  79.  
  80. - All Sandbox engine APIs (Sandbox.Engine/*, etc.) — no restrictions
  81. - Standard collections, LINQ, immutable/concurrent collections
  82. - MemoryStream, Stream, BinaryReader/Writer — in-memory IO only
  83. - HttpClient-related types (via Sandbox.Engine), HttpResponseMessage, content types
  84. - MD5, SHA1, SHA256, SHA512 hashing
  85. - System.Text.Json fully
  86. - Regex
  87. - async/await machinery, Task/ValueTask, CancellationToken, Channels
  88. - Span<T>, ReadOnlySpan<T>, Memory<T>
  89. - Limited System.Type (15 specific methods — enough for is, typeof, GetInterfaces, IsAssignableFrom, etc.)
  90. - Limited reflection for metadata reading only (property names, attribute data, parameter info)
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment