fix(security): 스케줄러 Shell/Artisan 명령 실행 하드닝
미출시 예약 작업 기능에서 스케줄 권한만 위임받은 계정이 Shell/Artisan 명령으로 임의 코드를 실행할 수 있던 문제를 선제적으로 차단(KVE-2026-1567). Shell 은 기본 차단 + 실행 파일 화이트리스트 + 셸 미경유 인자배열 실행, Artisan 은 차단목록. 저장 시점(FormRequest)과 실행 시점(Service) 이중 검증. 아울러 공개 release 보다 앞선 미출시 버전들의 CHANGELOG 출시 날짜를 2026-07-14 로 통일.
This commit is contained in:
1 parent
4c73db2e91
commit
ce8e55b390
23 files changed
+957
-25
No files matched your search
@@ -6,6 +6,8 @@ use App\Enums\ExtensionOwnerType;
|
||||
use App\Enums\ScheduleFrequency;
|
||||
use App\Enums\ScheduleType;
|
||||
use App\Extension\HookManager;
|
||||
use App\Rules\AllowedArtisanCommand;
|
||||
use App\Rules\AllowedShellCommand;
|
||||
use App\Rules\PublicOutboundUrl;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
@@ -38,7 +40,8 @@ class CreateScheduleRequest extends FormRequest
|
||||
'name' => 'required|string|max:255',
|
||||
'description' => 'nullable|string|max:1000',
|
||||
'type' => "required|string|in:{$types}",
|
||||
// URL 호출 스케줄이면 command 가 곧 서버의 outbound 목적지가 되므로 내부망 주소를 차단한다
|
||||
// command 는 타입별로 서버의 outbound 목적지(URL)·OS 명령(Shell)·PHP 코드(Artisan)가 되므로
|
||||
// 각 타입에 맞는 실행 허용 검증을 저장 시점에 건다
|
||||
'command' => [
|
||||
'required',
|
||||
'string',
|
||||
@@ -47,6 +50,14 @@ class CreateScheduleRequest extends FormRequest
|
||||
$this->input('type') === ScheduleType::Url->value,
|
||||
[new PublicOutboundUrl],
|
||||
),
|
||||
Rule::when(
|
||||
$this->input('type') === ScheduleType::Shell->value,
|
||||
[new AllowedShellCommand],
|
||||
),
|
||||
Rule::when(
|
||||
$this->input('type') === ScheduleType::Artisan->value,
|
||||
[new AllowedArtisanCommand],
|
||||
),
|
||||
],
|
||||
'expression' => 'required|string|max:100',
|
||||
'frequency' => "required|string|in:{$frequencies}",
|
||||
|
||||
Reference in new issue
Block a user