T05 · Unauthorized Access and Privilege Escalation
- Location
tibber_energy.py:105- Finding
Price Query Collects Unnecessary Customer Identity and Address Data
- Content
View full analysis
Vulnerability Details
File Location:
tibber_energy.py, lines 105–126
Vulnerability Type: Excessive sensitive-data collection and violation of least privilege
Risk Level: MediumVulnerable Code:
python QUERY_HOME_PRICES = """ query HomeElectricityPrices { viewer { homes { id appNickname timeZone address { address1 postalCode city } owner { firstName lastName contactInfo { email mobile } }Technical Analysis
The GraphQL query used by price-related operations requests the customer's street address, postal code, city, first and last name, email address, and mobile number. The declared price retrieval, optimization, and threshold-control features do not require most of these fields.
The implementation subsequently uses the home ID, nickname, timezone, city, subscription information, and price data. It does not use
address1,postalCode, the owner's name, email address, or mobile number. Requesting those fields therefore exceeds the minimum data access necessary for the operations being performed.The request is authenticated using the user's Tibber bearer token and is sent to Tibber's official HTTPS API. There is no evidence that the returned personal data is forwarded to an unrelated third party. Nevertheless, retrieving unused sensitive data unnecessarily places it in the process response body and parsed object graph, increasing exposure in the event of debugging, instrumentation, memory inspection, exception handling changes, or a compromised runtime.
Attack Path
- A user configures a valid
TIBBER_ACCESS_TOKEN. - The user invokes
prices,optimize, orcontrol. fetch_prices()submitsQUERY_HOME_PRICESusing the bearer token.- Tibber returns customer identity, contact, and detailed address fields in addition to ...[truncated 718 chars]
- A user configures a valid
- Remediation
View remediation
Remediation Suggestions
Restrict the GraphQL selection set to fields required by the active feature:
- Remove the entire
ownerselection. - Remove
address1andpostalCode. - Remove
cityunless displaying a city in_home_title()is an explicit functional requirement. - Consider separate, narrowly scoped queries for price retrieval, optimization, and control.
- Document precisely which account information each command retrieves.
- Add an automated test that rejects identity and contact fields in price-only GraphQL queries.
A minimized home selection could be structured as follows:
python homes { id appNickname timeZone currentSubscription { status priceInfo { # Required price fields only } } }- Remove the entire
