Commit 23ad9a2
committed
Security: Block raw DLL references, enforce NuGet-only dependencies
This change prevents users from adding .dll files to job packages. All external dependencies must be declared as NuGet packages in the .nuspec file and resolved via NuGetResolverService.
Changes:
1. CodeExecutorService.cs (Core/Services)
- Removed code that blindly loaded all .dll files from extracted packages
- Added security check that rejects execution if any .dll files are found in the package
- Removed secondary loop that pre-loaded package DLLs into the AppDomain
- NuGet-resolved assemblies (via .nuspec) continue to work as before
2. JobManager.cs (Core)
- Replaced the DLL scanning/loading loop with a security check
- Throws InvalidOperationException if .dll files are found in the package
- Logs a security-level error message identifying the rejected DLL files
3. NuGetPackageBuilderService.cs (Core/Services)
- Added validation at the start of BuildPackageAsync()
- Rejects the build if the source directory contains any .dll files
- Returns a clear error message listing the offending files
4. PackageProcessorService.cs (Core/Services)
- Added DLL detection to ValidateNuSpecAsync()
- Packages containing .dll files now fail validation with a descriptive error
5. JobDetailsDialog.razor (Web/Components/Pages/Dialogs)
- Added client-side validation during package upload (.nupkg/.zip)
- Inspects zip archive entries for .dll files before uploading
- Rejects upload with a user-friendly notification listing found DLLs
Defense in depth: The restriction is enforced at every layer - package build, package upload, package validation, and package execution.1 parent 7816844 commit 23ad9a2
5 files changed
Lines changed: 57 additions & 33 deletions
File tree
- src
- BlazorDataOrchestrator.Core
- Services
- BlazorOrchestrator.Web/Components/Pages/Dialogs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
| 497 | + | |
| 498 | + | |
498 | 499 | | |
499 | | - | |
| 500 | + | |
500 | 501 | | |
501 | | - | |
502 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
503 | 505 | | |
504 | 506 | | |
505 | 507 | | |
| |||
Lines changed: 8 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
| 181 | + | |
181 | 182 | | |
182 | | - | |
| 183 | + | |
183 | 184 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
193 | 190 | | |
194 | 191 | | |
195 | 192 | | |
| |||
234 | 231 | | |
235 | 232 | | |
236 | 233 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | 234 | | |
256 | 235 | | |
257 | 236 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
128 | 143 | | |
129 | 144 | | |
130 | 145 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
806 | 825 | | |
807 | 826 | | |
808 | 827 | | |
| |||
0 commit comments