Skip to content

๐Ÿ›ก๏ธ Sentinel: [HIGH] ๊ด€๋ฆฌ์ž ์—”๋“œํฌ์ธํŠธ ๊ถŒํ•œ ์šฐํšŒ ์ทจ์•ฝ์  ์ˆ˜์ • - #205

Closed
seonghobae wants to merge 1 commit into
mainfrom
fix/admin-endpoint-auth-4453114746080638427
Closed

๐Ÿ›ก๏ธ Sentinel: [HIGH] ๊ด€๋ฆฌ์ž ์—”๋“œํฌ์ธํŠธ ๊ถŒํ•œ ์šฐํšŒ ์ทจ์•ฝ์  ์ˆ˜์ •#205
seonghobae wants to merge 1 commit into
mainfrom
fix/admin-endpoint-auth-4453114746080638427

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Superseded by #172. The same admin authorization gap is addressed there with distinct admin:read and admin:write permissions and successful exact-head checks.

์ด ์ปค๋ฐ‹์€ `AdminController`์˜ ๋ฏผ๊ฐํ•œ ์ž‘์—…(`getAllJobs`, `deleteJob`, `retryDeadLettered`)์— ๋ˆ„๋ฝ๋œ ์ ‘๊ทผ ์ œ์–ด๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๋ณด์•ˆ ์ทจ์•ฝ์ ์„ ํ•ด๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

๋ณ€๊ฒฝ ์‚ฌํ•ญ:
- `TenantPermissions`์— `ADMIN_READ` ๋ฐ `ADMIN_WRITE` ๊ถŒํ•œ ์ƒ์ˆ˜๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.
- `AdminController`์— `TenantAccessService`๋ฅผ ์ฃผ์ž…ํ•˜๊ณ , ๋ชจ๋“  ์—”๋“œํฌ์ธํŠธ ๋ฉ”์„œ๋“œ์—์„œ ์ ์ ˆํ•œ ๊ถŒํ•œ์„ ํ™•์ธํ•˜๋„๋ก ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.
- `AdminControllerTest`๋ฅผ ์—…๋ฐ์ดํŠธํ•˜์—ฌ `TenantAccessService` ๋ชฉ(Mock) ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
- ๋ณด์•ˆ ์—”๋“œํฌ์ธํŠธ์— ๋Œ€ํ•œ ์ธ์ฆ/์ธ๊ฐ€ ๋ˆ„๋ฝ ์ทจ์•ฝ์ ์„ ์„ค๋ช…ํ•˜๋Š” ํ•™์Šต ๋‚ด์šฉ์„ Sentinel ์ €๋„์— ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.
@google-labs-jules

Copy link
Copy Markdown

๐Ÿ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a ๐Ÿ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings July 25, 2026 21:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a high-severity authorization bypass by enforcing tenant-authn/authz checks on AdminController endpoints, ensuring only callers with explicit admin permissions can list, delete, or retry conversion jobs.

Changes:

  • Added admin:read / admin:write permissions to TenantPermissions.
  • Injected TenantAccessService into AdminController and required the appropriate permission per admin endpoint.
  • Updated tests and documented the security learning in .jules/sentinel.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/main/java/com/clearfolio/viewer/controller/AdminController.java Enforces tenant permission checks on admin endpoints via TenantAccessService.require(...).
src/main/java/com/clearfolio/viewer/auth/TenantPermissions.java Adds new admin permission constants (ADMIN_READ, ADMIN_WRITE).
src/test/java/com/clearfolio/viewer/controller/AdminControllerTest.java Adjusts test wiring for the new TenantAccessService dependency (and should better enforce permission expectations).
.jules/sentinel.md Records the vulnerability/learning/prevention note for the admin authz fix.
Comments suppressed due to low confidence (1)

src/main/java/com/clearfolio/viewer/controller/AdminController.java:39

  • The field JavaDoc block indentation is inconsistent (extra leading spaces) and may trip checkstyle/formatting rules. Align it with the rest of the codebaseโ€™s indentation (e.g., ConversionControllerโ€™s JavaDoc at src/main/java/com/clearfolio/viewer/controller/ConversionController.java:53-60).
        /**
     * Tenant access service.
     */
    private final TenantAccessService tenantAccessService;

๐Ÿ’ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to +38
// By default, allow everything
when(tenantAccessService.require(any(HttpHeaders.class), any(String.class))).thenReturn(tenantContext);
Comment on lines +32 to 35
/**
* Document conversion service.
*/
private final DocumentConversionService conversionService;
Comment thread .jules/sentinel.md
Comment on lines 34 to +35
**Prevention:** Always enforce a strict, configurable size limit (e.g., `ConversionProperties.maxUploadSizeBytes`) within the `while` loop that reads from untrusted input streams. Track `totalRead` and throw an exception immediately if the limit is exceeded.
## 2026-07-25 - ๊ด€๋ฆฌ์ž ์—”๋“œํฌ์ธํŠธ ์ธ์ฆ/์ธ๊ฐ€ ๋ˆ„๋ฝ ํ•ด๊ฒฐ
@seonghobae seonghobae closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants