T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/sheets.mjs:47- Finding
Read-Only Commands Request Full Google Sheets Read/Write Access
- Content
View full analysis
- Remediation
View remediation
({ title: s.properties.title, sheetId: s.properties.sheetId, rowCount: s.properties.gridProperties?.rowCount, colCount: s.properties.gridProperties?.columnCount, })), }; } ``` 3. Use the full Sheets scope only for `appendRows()` and `writeRange()`. 4. Cache tokens by scope instead of using one global token slot. ```js const tokenCache = new Map(); async function getAccessToken(scope) { const cached = tokenCache.get(scope); if (cached && Date.now() < cached.expiresAt - 60000) { return cached.token; } // Create a token for the requested s ...[truncated 456 chars]
