4. 1.1 버그바운티란
버그바운티 프로그램이란 ?
Bug Bounty
Program
1. 취약점 보고
2. 심사 및 취약점 수정
(보상금 책정)
3. 보상금 수령
Hackerone, Bugcrowd
Google, Facebook,
LINE, NAVER
Microsoft, Samsung
자사운영형태 전문대행회사 이용형태
5. 1.1 버그바운티란
취약점 발견시 어디에 연락해야 하는가?
A社
취약점 보고창구가 없음
(제품문의 접수폼/email)
B社
취약점 보고창구가 있음
(취약점보고 접수폼/email)
C社
취약점 보고창구가 있음
(버그바운티 프로그램)
기관운영&비영리 단체
(취약점보고 접수폼/email)
KISA, IPA, CNVD
국내 : LINE, NAVER, SAMSUNG 등
해외 : Google, Facebook, Microsoft, Tencent 등
제품벤더(microsoft, juniper, panasonic 등)
6. 1.2 버그바운티의 효용성
버그바운티 프로그램은
- 해커를 고용하는 가장 좋은 방법
- 회사의 보안을 지키는 가장 좋은 방법
“Not running a bug bounty program amounts to negligence.” - Joe Sullivan, Uber’s CISO
“The best thing we have done to secure Facebook is to have a bug bounty program” - Sheryl
Sandberg, COO, Facebook
(https://www.youtube.com/watch?v=fzL9r47F4-8)
화이트 해커 참여에 의한 취약점 정보, 노하우를 배울 수 있다.
해커들은 다각도로 다양한 서비스를 보고 있기 때문에 한곳에 발견된 서비스가 다른 곳에도
있는지도 본다.
7. 1.2 타사의 사례 https://hackerone.com/directory?query=
2010 2011 2012 2013 2014 2015 2016 2017 2018
Google
Facebook
Microsoft
LINE
https://bugcrowd.com/programs
8. 1. 대상앱
·LINE for iOS
·LINE for Android
·LINE for Chrome
·LINE for Windows 10 Mobile
2. 대상 WEB사이트
·https://store.line.me/
·https://news.line.me/
·https://music.line.me/
·https://live.line.me/
3. 기타
·참가조건, 취약성으로 인정되지 않는 항목, 금지항목 등
· 홈페이지에 상세내용 기재
·이용규약 참조
https://bugbounty.linecorp.com/
1.3 LINE Security Bug Bounty Program
취약성명 설명 참고금액
SQL Injection Ability to access private information through an SQL injection attack USD 3,000
Cross-Site Scripting (XSS) Ability to hijack a session or execute scripts through an XSS attack USD 500~
Cross-Site Request Forgery (CSRF)
Ability to force a LINE user to perform an undesired process through a
CSRF attack
USD 500
Remote Code Execution
Ability to send packets containing arbitrary code to the client or server
side
USD 10,000
Authentication Bypass
Ability to masquerade as another person by bypassing authentication
procedures
USD 5,000
Purchase Bypass Ability to obtain items while bypassing in-app payment procedures USD 5,000
Encryption Break
Ability to obtain another person’s authentication information by cracking
encrypted data
USD 10,000
Improper Certificate Validation Ability to obtain sensitive information by failing to validate SSL certificate. USD 10,000
Server-Side Request Forgery (SSRF)
Ability to abuse functionality on the server to read or update internal
resources.
USD 2,500
Client-Side Enforcement of Server-Side
Security
Ability to bypass protection mechanism by relying on the client side
protection only.
USD 500
Improper Access Control
Ability to access originally non-public pages because of access control
failure.
USD 500~
Password in Configuration File Ability to obtain a password or sensitive information in a configuration file. USD 500
Insecure Direct Object Reference (IDOR)
Ability to bypass authorization and access resources directly by modifying
the value of a parameter.
USD 5,000
Information Exposure Through Debug
Information
Ability to obtain sensitive information through debugging information. USD 500
Privilege Escalation
Ability to obtain elevated access to resources that are normally protected
from an application or user.
USD 3,000
Cleartext Transmission of Sensitive
Information
Ability to eavesdrop sensitive information in the network traffic. USD 500~
Path Traversal Ability to access arbitrary files and directories by manipulating variables USD 500~
Other Other vulnerabilities USD 500
9. 2015년부터 프로그램 자체 운영, for hacker, by hacker
1.3 라인 버그바운티 / 운영통계
2015년
(프로그램 실시)
2016년
(상시 운영 개시)
2017년
(프로그램 대상 확대)
2018년
(보상금 테이블 갱신)
실시 기간 8/24~9/23 6/2~12/31 1/1~12/31 1/1~6/30
접수 건수
194건
(일본:89, 한국 포함 타 국가:105)
97건
(일본:15, 한국 포함 타
국가:82)
212건
(일본:11, 한국 포함 타
국가:201)
148건
(일본:35, 한국 포함 타
국가:113)
보상금 대상의 취약점 수 14건 13건 45건 33건
hall of fame 8명 3명 11명 9명
special contributors 9명 8명 21명 11명
발생한 보상금 USD 44,000 USD 27,000 USD 76,500 USD 48,000
Double reward program by hackerone+google
https://hackerone.com/googleplay
10. 1.3 라인 버그바운티 / 운영통계
한국어 : https://engineering.linecorp.com/ko/blog/detail/329
영어 : https://engineering.linecorp.com/en/blog/detail/329
12. 2.1 의 위협
LINE
app
기프트 서비스
네이티브 기능제공(js)
• 친구리스트
• 토큰(유저식별자 등)
• 프로필 정보
• 라인앱이 제공하는 다양한 기능
WebView에서는 라인앱이 제공하는 네이티브 기능에 접근하여
다양한 서비스를 제공
선물 보내기
게임서비스
하트 요청하기
WebView
WebView
xxx서비스
xxx
WebView
13. 네이티브 기능에 접근하는 에서 페이지의 로딩은 위험하다
또한 로딩되는 페이지가 일지라도 가 존재하면 위험하다
2.1 의 위협
webview
http://normal.site
네이티브기능제공api
by addjavascriptinterface
Native App
http://attack.site
• http페이지가 MITM공격에 의한 변조
• 스크립트 실행가능한 XSS
webview
네이티브기능제공api
by addjavascriptinterface
Native App
15. MITM ? Webview서비스는 모두 https 대응
상시SSL(AOSSL: Always On SSL) 은 이제 기본
- https://about.yahoo.co.jp/info/aossl/
- App Transport Security
- https://transparencyreport.google.com/http
메시지, 통화기능에 관련한 리포트
- https://linecorp.com/en/security/encryption_report
XSS ? 버그 바운티 프로그램에서 가장 많이 보고되는 웹취약점, XSS대응은 이스케이프 처리가 기본
기업이 공개한 xss filter사례
• https://github.com/naver/lucy-xss-filter
• https://github.com/salesforce/secure-filters
-로그인 도메인에서의 XSS 는 2,500달러 지급사례
-webview서비스에서의 XSS 는 1,500달러 지급사례
-결제 도메인에서의 XSS 는 1,500달러 지급사례
2.1 how should
『&』 --> 『&』
『<』 --> 『<』
『>』 --> 『> 』
『"』 --> 『" 』
『'』 --> 『' 』
17. 대책 : POST 랜덤 파라메터 혹은 리퍼러 헤더, 커스텀 헤더 (공격자가 링크를 못만들도록 하기 위함)
Referer: https://service.domain vs Referer: https://service.domain.attacker.domain
커스텀 헤더의 장점 :
서버에서 헤더만 추가하는 심플한 방법, 커스텀 헤더로 인증을 관리하는 도메인에서는 CSRF가 발생하지 않는다.
쿠키헤더로 인증을 관리하는 사이트에서 CORS설정이 * 로 되어 있으면 CSRF이 가능하게 되어 크로스 도메인에서 api에 접근
가능한 문제가 발생하는 경우가 있음
2.2 how should
https://service.domain/api/users.json https://attacker.domain/users.html
1
GET /api/user.json
Host: service.domain
User-agent: xxxx
Cookie: session_id=131a3ea092zegxil7; xxx
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
{name: deview, tel:010-1234-5678, address:”seoul”, …}
<html> <head><script>
var req = new XMLHttpRequest();
req.open('get','https://service.domain/api/users.json',true);
req.withCredentials = true;
req.onload = reqListener;
req.send();
function reqListener() {
alert(req.responseText)
};
</script> </head> <body> TESTING </body> </html>
2
GET /api/user.json
Host: service.domain
User-agent: xxxx
Auth-Token: 131a3ea092zegxil7; xxx
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
{name: deview, tel:010-1234-5678, address:”seoul”, …}
공격불가능
18. 당신의 사이트에는 기능이 있습니까
2.3 Open Redirect
https://sign.service.domain/auth/login?redirectUrl=https%3A%2F%2Fservice.domain
https://sign.service.domain/auth/login?redirectUrl=https%3A%2F%2Fservice.domain
로그인을 환영합니다.
https://service.domain
ID
PASS
https://sign.service.domain/auth/login?redirectUrl=https%3A%2F%2attacker.domain
https://sign.service.domain/auth/login?redirectUrl=https%3A%2F%2Fattacker.com
로그인을 환영합니다
패스워드를 변경해 주세요
https://attacker.domain
ID
PASS
19. 2.3 Open Redirect
User agent client Service provider
Oauth 2.0인증개시
인증페이지 리다이렉트
인증화면표시
Callback 유알엘로 인가코드를 Redirect
인증/인가
https://client.service/ https://service.provider/
https://client.service/login/callback?code=인가토큰&state=rando
m
엑세스토큰 요청(/w 인가토큰)
엑세스토큰 발행
https://attacker.domain%5c@client.service/
https://attacker.domain@client.service/login/callback?code=【인가토큰】&state=random
https://service.provider/oauth/weblogin?client_id=1234567890
&redirect_uri=https://client.service/login/callback?response_type=code&stat
e=random
공격payload
서버의 호스트체크를 바이패스한 사례
@client.service 부분이 host파트로 인식되어 체크로직에서
바이패스됨 url.getUserInfo() 체크추가
20. 1. 외부 도메인에 redirect 필요시 화이트 리스트 방식으로 관리
- Ex) /^https://white.domain/
2. 외부 도메인에 redirect 필요없을시에는 경로만 지정
- 취약ex) : location.replace(get_query_param("redirectUrl"))
- 안전ex) : location.replace("/path/to/app/" + get_query_param("redirectUrl"));
3. 바이패스에 주의하자
- attacker.domain%5C@service.domain
- attacker.domain#@service.domain
@service.domain 부분이 host파트로 인식되어 체크로직에서 바이패스되는 경우가 있으므로 url.getUserInfo() 체크추가
- attacker.domain/service.domain
2.3 how should
21. 에 취약할 수 있는 곳 내부 이미지 로딩하는 부분 등
2.4
https://developers.line.me/console/channel/1510978178/basic/ https://clova-developers.line.me/cek/#/skill/com.example.test/ja_JP/edit/config
https://service.domain/getimage.php?url=/image/test.png
-http://127.0.0.1:8080 / http://사내시스템IP (or 추측 가능한 도메인 or jenkins, Elasticsearch GET rest api)
22. 1. Restrict the URL protocol to HTTP and HTTPS.
- 불필요한 『javascript:』 , 『ftp://』, 『file://』스킴도 허용하면 안된다.
2. DNS lookup the host name and check it's not a local address.
- localhost 및 사내 내부 IP를 허용하면 안된다.
- Java의 경우 InetAddress의 getByName/getHostAddress을 사용해서 DNS resolve하여 사내IP인지를 체크가능
3. Disable redirects.
4. bypass에 주의하자
- https://127.0.0.1 vs https://127.0.0.1#test@example.com
- javascript://alert(1)//http://example.com 선두일치 체크가 안된 사례
- https://[::]/ (localhost in IPv6)
2.4 how should
23. • /server-status, /jkmanager 등의 페이지가 외부에서 접근 가능하지 않습니까
• jenkins서버가 인증없이 외부에서 접근 가능하지는 않습니까
• memcached 서버가 인증없이 외부에서 접근 가능하지 않습니까
• mongoDB서버가 인증없이 외부에서 접근 가능하지 않습니까
2.5 서버 설정미스로 인한 정보노출
https://www.shodan.io/
mongodb
jenkins
X-application-Context
org:”xxxcorp” jenkins
org:”xxxcorp” mongodb
org:”xxxcorp” port:”11211”
org:”xxxcorp” country:”KR” port:”443”
$telnet a.b.c.d 11211
stats items
stats cachedump 숫자 숫자
Spring boot actuator endpoint
/trace
/dump
/env
/autoconfig
/beans
/health
/mappings
/shutdown
Pip install wpscan
Wpscan –url https://service.domain
32. 8 % 7 8 1 0 62
3.5 2017 버그바운티 결과
0
20
40
60
80
100
120
XSS
CSRF
서
비
스
어
뷰
징
리
다
이
렉
트
불
필
요
한
메
소
드
노
출
DLL
Hijacking
Blind
XXE
Injection
서
버
버
전
정
보
노
출
세
션
탈
취파
일
탈
취
취
약
점취
약
점
버
전
노
출
파
일
다
운
로
드
2017년 NAVER BUGBOUNTY