공유 피드백 링크가 검색엔진에 색인되던 문제 - #195
Merged
Merged
Conversation
/share/<token> 은 "링크를 받은 사람만" 보라고 만든 페이지인데 색인을 막는 장치가 하나도 없었다(robots.txt 없음, meta robots 없음). 사용자가 그 링크를 블로그나 커뮤니티에 붙이면 크롤러가 따라 들어와 리포트 전문 — 강점·약점·학습 방향, 전부 본인 이력서에서 파생된 내용 — 을 색인한다. 토큰은 UUIDv4 라 추측으로는 못 찾지만, 링크 유출은 공유 기능의 정상 사용 과정에서 일어난다. 1차 방어는 robots.txt Disallow 다. 프론트가 정적 파일로 배포돼 응답 헤더 (X-Robots-Tag)를 붙일 수 없어서 크롤링 자체를 막는 쪽을 택했다. 2차로 useNoIndex 훅이 공유 페이지에서만 meta robots 를 붙였다 뗀다 — robots.txt 를 무시하면서 JS 는 실행하는 크롤러 대비. index.html 에 정적으로 넣지 않은 건 SPA 라 문서가 하나뿐이라서다. 그렇게 하면 랜딩 페이지까지 통째로 색인에서 빠진다.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
문제
/share/<token>은 "링크를 받은 사람만" 보라고 만든 읽기 전용 페이지다. 그런데 색인을 막는 장치가 하나도 없었다.public/robots.txt자체가 없음index.html에도, 라우트에도meta robots없음사용자가 공유 링크를 블로그·커뮤니티·오픈 채팅에 붙이면 크롤러가 링크를 따라 들어와 리포트 전문을 색인한다 — 강점·약점 요약, 개선 키워드, 학습 방향. 전부 본인 이력서·레포에서 파생된 내용이다.
토큰이
UUID.randomUUID()(122비트)라 추측으로는 못 찾는다. 하지만 색인의 유입 경로는 추측이 아니라 링크이고, 링크 유출은 공유 기능의 정상 사용 과정에서 일어난다. "아는 사람만 보는 링크"와 "검색하면 나오는 페이지"는 전혀 다른 노출 범위다.수정
1차 —
public/robots.txt신규프론트가 정적 파일로 배포되고(
deploy-app.yml→/var/www/stackup/frontend/dist/) 게이트웨이 설정이 레포 밖이라X-Robots-Tag응답 헤더를 붙일 수 없다. 그래서 크롤링 자체를 막는 쪽을 택했다.2차 —
useNoIndex훅공유 페이지가 떠 있는 동안만
<meta name="robots" content="noindex, nofollow, noarchive">를 붙이고 언마운트 시 걷어낸다. robots.txt 는 무시하면서 JS 는 실행하는 크롤러 대비.index.html에 정적으로 넣지 않은 이유: SPA 라 문서가 하나뿐이다. 거기 넣으면 랜딩 페이지까지 통째로 색인에서 빠진다.확인한 것 (문제 없음)
FeedbackResponse.fromPublic이shareToken을 지우고, 이름·이메일·GitHub 계정은 애초에 필드에 없다FeedbackReport만 렌더 — 실제 문답 전문(InterviewTranscript)은 소유자 화면에만 있다shareableprop 게이팅으로 소유자 화면에서만 노출테스트
useNoIndex.test.ts2 케이스 — 마운트 시 meta 주입, 언마운트 시 제거(안 걷어내면 다른 페이지로 이동한 뒤에도 남아 앱 전체가 색인에서 빠진다).npm run build로dist/robots.txt가 산출물에 포함되는 것을 확인했다.