Skip to content

[codex] Secure schedule finish authorization#291

Merged
jjoonleo merged 2 commits intomainfrom
feat/implement-issue-272
May 7, 2026
Merged

[codex] Secure schedule finish authorization#291
jjoonleo merged 2 commits intomainfrom
feat/implement-issue-272

Conversation

@jjoonleo
Copy link
Copy Markdown
Contributor

@jjoonleo jjoonleo commented May 7, 2026

Summary

  • bind the finish endpoint path scheduleId and make it authoritative
  • validate optional body scheduleId mismatch with a 400 error
  • authorize schedule ownership before lateness and punctuality score mutation
  • reject repeated finish calls to avoid double-counting punctuality score
  • add regression coverage for success, missing schedule, wrong owner, mismatch, and repeated finish

Root cause

The finish endpoint ignored the path parameter and the service loaded the schedule directly from the request body UUID, so any authenticated user could finish another user's schedule if they knew or guessed its UUID.

Validation

  • ./gradlew compileTestJava
  • ./gradlew test --tests devkor.ontime_back.controller.ScheduleControllerTest

Note: the focused ScheduleServiceTest class could not be executed locally because the Spring Boot test context attempted to connect to MySQL and the local connection was refused.

Closes #272

@jjoonleo jjoonleo marked this pull request as ready for review May 7, 2026 05:18
@github-actions github-actions Bot closed this May 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

실패하는 테스트코드가 있어 PR이 자동으로 닫혔습니다.
Github Action에서 자세한 실패 로그를 확인하고 코드를 수정하세요.

@jjoonleo jjoonleo reopened this May 7, 2026
@github-actions github-actions Bot closed this May 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

실패하는 테스트코드가 있어 PR이 자동으로 닫혔습니다.
Github Action에서 자세한 실패 로그를 확인하고 코드를 수정하세요.

@jjoonleo jjoonleo reopened this May 7, 2026
@jjoonleo jjoonleo merged commit a70ae7f into main May 7, 2026
4 checks passed
@jjoonleo jjoonleo deleted the feat/implement-issue-272 branch May 7, 2026 05:35
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.

[P0] Fix authorization bypass in schedule finish endpoint

1 participant