T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/daily-report.sh:153- Finding
Monthly report queries fail to enforce user-level record isolation
- Content
View full analysis
/dev/null || echo "0") local last_day=$(date -d "${year}-${month}-01 +1month -1day" +%Y-%m-%d 2>/dev/null || echo "${year}-${month}-28") end_ts=$(date -d "$last_day 23:59:59" +%s000 2>/dev/null || echo "0") npx -y mcporter call "tencent-docs" "smartsheet.list_records" \ --args "{ \"file_id\": \"$FILE_ID\", \"sheet_id\": \"$SHEET_ID\", \"limit\": 500 }" 2>/dev/null | python3 -c " import sys, json, datetime try: data = json.load(sys.stdin) records = data.get('records', []) results = [] for rec in records: fields = rec.get('field_values', []) rec_info = {} for f in fields: fname = f.get('field', '') if '日期' in fname: try: ts = int(f.get('string_value', 0)) rec_info['date'] = datetime.datetime.fromtimestamp(ts/1000).strftime('%Y-%m-%d') except: rec_info['date'] = '' elif '工时' in fname: rec_info['hours'] = f.get('number_value', 0) elif '工作内容' in fname: texts = f.get('text_value', {}).get('items', []) rec_info['content'] = ''.join(t.get('text', '') for t in texts) elif '类型' in fname: rec_info['type'] = f.get('option_value', {}).get('items', [{}])[0].get('text', '') if rec_info: rec_info['id'] = rec.get('record_id', '') results.append(rec_info) # Filter by month ...[truncated 2290 chars]- Remediation
View remediation
