Files
Gnuboard7/plugins/_bundled/sirsoft-gdpr/src/Providers/GdprServiceProvider.php
T
chym1217 2a036704f4 fix(sirsoft-gdpr): 쿠키 동의 보안 결함 3건 수정 + 하위호환 고지
이슈 체크리스트와는 별개로, 처리 완료 후 지시로 진행한
sirsoft-gdpr 플러그인 전수 비판적 검토에서 발견한 보안·결함 3건을
수정한다.

- Admin 설정 저장 API 의 검증 우회 fallback(빈 요청 시 $request->all
 사용) 제거. UpdateAdminSettingsRequest 필드가 모두 nullable 이라
 검증을 거치지 않은 임의 키가 저장 로직까지 전달될 수 있었다.
- 게스트 세션 식별 쿠키(gdpr_session) 에 HMAC-SHA256 서명 적용.
 api 미들웨어 그룹에는 EncryptCookies 가 없어 쿠키가 평문으로 오가
 임의 UUID로 타인의 게스트 동의 상태를 조회/철회할 수 있었다.
 결제 플러그인들의 IssuesReceiptCookie 트레이트와 동일 컨벤션 채택.
 이 조치로 배포 이전 발급된 비회원 쿠키는 1회 초기화되며 이미
 배너를 닫았던 비회원은 다음 방문 시 배너를 다시 보게 된다(회원
 동의 이력은 영향 없음) — CHANGELOG 에 고지.
- 게스트로 쿠키 배너를 닫은 뒤 동의 이력 없는 다른 계정으로 로그인해도
 배너가 계속 숨겨져 있던 결함 수정. _global.gdprBannerDismissedFor 가
 "닫힘 여부"(boolean) 대신 "누가 닫았는지"(사용자 식별자)를 저장하도록
 변경해, 로그인으로 사용자가 바뀌면 다시 노출되게 한다. 실제 로그인
 폼 제출을 거쳐 재현하는 E2E spec 신규 작성(PlaywrightSeedGdprGuestLogin
 시드 커맨드 포함, sirsoft-page 의 PlaywrightSeedPage 패턴 재사용).

부수: 자동 차단 정책 안내에 보호 범위 한계 고지 추가, GDPR 플러그인
번들 로딩 우선순위 상향(다른 확장의 스크립트로부터 보호 범위 확대).
2026-07-30 10:50:49 +09:00

43 lines
1.7 KiB
PHP

<?php
namespace Plugins\Sirsoft\Gdpr\Providers;
use App\Extension\BasePluginServiceProvider;
use Plugins\Sirsoft\Gdpr\Console\Commands\PlaywrightSeedGdprGuestLogin;
use Plugins\Sirsoft\Gdpr\Repositories\Contracts\GdprPolicyVersionRepositoryInterface;
use Plugins\Sirsoft\Gdpr\Repositories\Contracts\GdprUserConsentHistoryRepositoryInterface;
use Plugins\Sirsoft\Gdpr\Repositories\Contracts\GdprUserConsentRepositoryInterface;
use Plugins\Sirsoft\Gdpr\Repositories\GdprPolicyVersionRepository;
use Plugins\Sirsoft\Gdpr\Repositories\GdprUserConsentHistoryRepository;
use Plugins\Sirsoft\Gdpr\Repositories\GdprUserConsentRepository;
/**
* GDPR 플러그인 서비스 프로바이더.
*
* Repository 바인딩은 BasePluginServiceProvider 표준에 위임합니다.
* functional cookie 게이팅 미들웨어(CookieConsentMiddleware)는 코어 self-gate 방식으로
* 이관되어 Plugin::getMiddleware() 가 선언하고 코어 ExtensionMiddlewareGate 가 실행합니다.
* (SP Kernel 직접 조작 제거 — EDPB §16 광역 타게팅은 targets=['everything']/before_core 로 유지)
*/
class GdprServiceProvider extends BasePluginServiceProvider
{
protected string $pluginIdentifier = 'sirsoft-gdpr';
protected array $repositories = [
GdprUserConsentRepositoryInterface::class => GdprUserConsentRepository::class,
GdprUserConsentHistoryRepositoryInterface::class => GdprUserConsentHistoryRepository::class,
GdprPolicyVersionRepositoryInterface::class => GdprPolicyVersionRepository::class,
];
public function boot(): void
{
parent::boot();
if ($this->app->runningInConsole()) {
$this->commands([
PlaywrightSeedGdprGuestLogin::class,
]);
}
}
}