-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor : security path 경로 수정을 통한 문제 제출 이슈 해결 #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,213 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="ko"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
| <title>비밀번호 변경</title> | ||
| <style> | ||
| * { | ||
| box-sizing: border-box; | ||
| font-family: 'Gmarket Sans', sans-serif; | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
|
||
| body { | ||
| background: linear-gradient(to bottom right, #214d35, #0f111a); | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| min-height: 100vh; | ||
| color: white; | ||
| } | ||
|
|
||
| .reset-container { | ||
| width: 500px; | ||
| padding: 40px; | ||
| } | ||
|
|
||
| .reset-container h1 { | ||
| font-size: 32px; | ||
| font-weight: bold; | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| .reset-container p { | ||
| font-size: 16px; | ||
| margin-bottom: 40px; | ||
| } | ||
|
|
||
| .input-group { | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| .input-label { | ||
| display: block; | ||
| margin-bottom: 8px; | ||
| font-weight: 500; | ||
| } | ||
|
|
||
| .input-wrapper { | ||
| position: relative; | ||
| } | ||
|
|
||
| .input-wrapper input { | ||
| width: 100%; | ||
| padding: 12px 40px 12px 40px; | ||
| border: none; | ||
| border-radius: 8px; | ||
| font-size: 14px; | ||
| } | ||
|
|
||
| .input-wrapper img { | ||
| position: absolute; | ||
| top: 50%; | ||
| transform: translateY(-50%); | ||
| width: 20px; | ||
| height: 20px; | ||
| } | ||
|
|
||
| .input-wrapper .icon-left { | ||
| left: 10px; | ||
| } | ||
|
|
||
| .input-wrapper .icon-right { | ||
| right: 10px; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .submit-button { | ||
| width: 100%; | ||
| padding: 14px; | ||
| font-size: 16px; | ||
| font-weight: bold; | ||
| background-color: white; | ||
| color: #000; | ||
| border: none; | ||
| border-radius: 8px; | ||
| margin-top: 30px; | ||
| cursor: pointer; | ||
| transition: background 0.3s; | ||
| } | ||
|
|
||
| .submit-button:hover { | ||
| background-color: #ddd; | ||
| } | ||
| .modal { | ||
| position: fixed; | ||
| z-index: 9999; | ||
| left: 0; | ||
| top: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| background-color: rgba(0, 0, 0, 0.6); | ||
| display: none; | ||
| } | ||
|
|
||
| .modal-content { | ||
| background: #101618; | ||
| color: #fff; | ||
| width: 300px; | ||
| padding: 30px 20px; | ||
| border-radius: 12px; | ||
| text-align: center; | ||
| font-family: 'Gmarket Sans', sans-serif; | ||
| } | ||
|
|
||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="reset-container"> | ||
| <h1>비밀번호 변경</h1> | ||
| <p>새로운 비밀번호를 입력해주세요.</p> | ||
|
|
||
| <div class="input-group"> | ||
| <label class="input-label" for="newPassword">새로운 비밀번호</label> | ||
| <div class="input-wrapper"> | ||
| <img class="icon-left" src="/images/lock-icon.png" alt="자물쇠 아이콘"> | ||
| <input type="password" id="newPassword" placeholder="새로운 비밀번호를 입력해주세요."> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="input-group"> | ||
| <label class="input-label" for="newPasswordConfirm">비밀번호 재확인</label> | ||
| <div class="input-wrapper"> | ||
| <img class="icon-left" src="/images/lock-icon.png" alt="자물쇠 아이콘"> | ||
| <input type="password" id="newPasswordConfirm" placeholder="새로운 비밀번호를 확인해주세요."> | ||
| </div> | ||
| </div> | ||
|
|
||
| <button class="submit-button" onclick="submitPasswordReset()">비밀번호 변경</button> | ||
| </div> | ||
|
|
||
| <script> | ||
| function toggleVisibility(inputId, icon) { | ||
| const input = document.getElementById(inputId); | ||
| const isPassword = input.type === "password"; | ||
| input.type = isPassword ? "text" : "password"; | ||
| icon.src = isPassword ? "/images/eye-on-icon.png" : "/images/eye-off-icon.png"; | ||
| } | ||
|
|
||
| function getParamFromURL(param) { | ||
| const urlParams = new URLSearchParams(window.location.search); | ||
| return urlParams.get(param); | ||
| } | ||
| function showSuccessModal(message) { | ||
| const modalHtml = ` | ||
| <div id="success-modal" class="modal" style="display: flex; align-items: center; justify-content: center;"> | ||
| <div class="modal-content"> | ||
| <h3>완료</h3> | ||
| <p>${message}</p> | ||
| </div> | ||
| </div> | ||
| `; | ||
| document.body.insertAdjacentHTML('beforeend', modalHtml); | ||
| } | ||
|
|
||
| async function submitPasswordReset() { | ||
| const token = getParamFromURL("tempResetToken"); | ||
| const newPassword = document.getElementById("newPassword").value; | ||
| const newPasswordConfirm = document.getElementById("newPasswordConfirm").value; | ||
|
|
||
| if (!newPassword || !newPasswordConfirm) { | ||
| alert("모든 값을 입력해주세요."); | ||
| return; | ||
| } | ||
|
|
||
| if (newPassword !== newPasswordConfirm) { | ||
| alert("비밀번호가 일치하지 않습니다."); | ||
| return; | ||
| } | ||
|
|
||
| try { | ||
| const response = await fetch("/api/auth/reset-password", { | ||
| method: "POST", | ||
| headers: { | ||
| "Content-Type": "application/json" | ||
| }, | ||
| body: JSON.stringify({ | ||
| tempResetToken: token, | ||
| newPassword: newPassword, | ||
| newPasswordConfirm: newPasswordConfirm | ||
| }) | ||
| }); | ||
|
|
||
| if (!response.ok) { | ||
| const errorData = await response.json(); | ||
| throw new Error(errorData.message || "비밀번호 변경 실패"); | ||
| } | ||
|
|
||
| const result = await response.json(); | ||
| showSuccessModal(result.message || "비밀번호가 성공적으로 변경되었습니다."); | ||
|
|
||
| // 2초 뒤 로그인 페이지로 이동 | ||
| setTimeout(() => { | ||
| window.location.href = "/test/signin"; | ||
| }, 2000); | ||
| } catch (error) { | ||
| alert("오류 발생: " + error.message); | ||
| } | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XSS 취약점: 서버 메시지를 그대로 innerHTML 삽입
${message}가 escape 없이 모달에 삽입되어 있습니다. 악의적인 스크립트가 포함될 경우 클라이언트에서 실행될 수 있습니다.그리고 JS 쪽에서:
🤖 Prompt for AI Agents