other
- Location
scripts/booking_api.py:235- Finding
Fabricated Hotel, Pricing, Availability, and Review Data Presented as Live Booking.com Results
- Content
View full analysis
Vulnerability Details
File Location:
scripts/booking_api.py:235-286
Additional Locations:scripts/booking_api.py:310-341,scripts/booking_api.py:378-420,scripts/booking_api.py:446-476,scripts/booking_api.py:523;SKILL.md:17-20
Vulnerability Type: Deceptive fabricated travel and pricing data
Risk Level: HighVulnerable Code
python # TODO: Implement the real Booking API call # result = self._request("bookings.getHotels", params) # Mock response data mock_hotels = [ BookingHotel( hotel_id="123456", name="Hotel Granvia Tokyo", name_cn="Tokyo Station Hotel", address="1-9-1 Marunouchi, Chiyoda-ku", city="Tokyo", country="Japan", zip_code="100-0005", latitude=35.6812, longitude=139.7671, review_score=9.2, review_count=8542, star_rating=4, min_rate=25000, currency="JPY", facilities=["Free WiFi", "Restaurant", "Fitness center"] ), BookingHotel( hotel_id="123457", name="Shinjuku Granbell Hotel", name_cn="Shinjuku Granbell Hotel", address="2-14-5 Kabukicho, Shinjuku-ku", city="Tokyo", country="Japan", zip_code="160-0021", latitude=35.6938, longitude=139.7034, review_score=8.5, review_count=6234, star_rating=4, min_rate=18000, currency="JPY", facilities=["Free WiFi", "Bar", "24-hour front desk"] ) ] return { "code": 0, "msg": "success", "data": { "total": len(mock_hotels), ...[truncated 4637 chars]- Remediation
View remediation
Remediation Suggestions
- Remove all mock hotels, rooms, prices, reviews, availability flags, and cancellation policies from production execution paths.
- Restore and test the actual Booking.com Affiliate or partner API calls for every advertised query operation.
- Fail closed when valid credentials are absent. Placeholder credentials such as
your_api_keymust produce a clear configuration error rather than fallback data. - Keep fixtures only under a dedicated test directory and require an explicit test-mode configuration that cannot be enabled in production accidentally.
- Clearly label all test or demonstration responses as synthetic and never return them with the same success contract used for live inventory.
- Validate API responses against a strict schema before exposing them to the agent.
- Derive price, currency, tax inclusion, availability, meal-plan, and cancellation statements exclusively from explicit API response fields.
- Do not perform apparent currency conversion by changing only the displayed symbol. Preserve the source currency unless a trusted exchange-rate service performs and labels the conversion.
- Remove the unconditional tax and free-cancellation statement. Render such claims per hotel or room only when confirmed by authoritative policy data.
- Validate destinations, hotel identifiers, check-in and check-out dates, guest counts, room counts, language codes, currency codes, and pagination limits before issuing requests.
- Add integration tests that verify different destinations and identifiers produce corresponding live results rather than fixed records.
- Add provenance metadata to responses, including the upstream provider, retrieval timestamp, source currency, and whether the result is live or cached.
- Remove reservation creation, lookup, and cancellation claims from
SKILL.mduntil those operations are implemented and tested. If implemented later, require explicit user confirmation before ...[truncated 206 chars]
