feat(ui): complete Avalonia UI port with 7 main pages, tool settings & top MenuBar
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using ClawdDotNet.Core.Storage;
|
||||
using ClawdDotNet.Core.Tools;
|
||||
using FluentFTP;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -151,8 +152,13 @@ public sealed class FTPTool : IAgentTool
|
||||
basePath = Path.GetFullPath(basePath);
|
||||
var fullPath = Path.GetFullPath(Path.Combine(basePath, relativePath));
|
||||
|
||||
// Sicherheitsprüfung: Kein Ausbruch aus dem Workspace
|
||||
if (!fullPath.StartsWith(basePath, StringComparison.OrdinalIgnoreCase))
|
||||
// Sicherheitsprüfung: Kein Ausbruch aus dem Workspace.
|
||||
//
|
||||
// PathBoundary statt eines Zeichenketten-Präfixes: Es vergleicht auf
|
||||
// Verzeichnisgrenzen (sonst gälte "…/Workspace-Backup" als Teil von
|
||||
// "…/Workspace"), berücksichtigt die Groß-/Kleinschreibung des Dateisystems
|
||||
// und löst symbolische Verknüpfungen auf.
|
||||
if (!PathBoundary.IsInside(fullPath, basePath))
|
||||
{
|
||||
throw new UnauthorizedAccessException(
|
||||
$"Zugriff außerhalb des {label} Workspace-Verzeichnisses verweigert.");
|
||||
|
||||
Reference in New Issue
Block a user