cosad3s / postleaks

Search for sensitive data in Postman public library.
GNU General Public License v3.0
165 stars 24 forks source link

Whispers - Cannot parse specific result with JSON containing comments #6

Open cosad3s opened 3 months ago

cosad3s commented 3 months ago

Example of error:

[ERROR] Failed parsing file 'results_1710860101/8d829aa0-e5a3-49d4-a010-b770c0ac70df.json' with {
  "id": "8d829aa0-e5a3-49d4-a010-b770c0ac70df",
  "name": "Add Enrichment",
  "data": null,
  "auth": null,
  "events": null,
  "description": "Adds an enrichment at a specified position in a defined album.\n\n### HTTP request\n\n`POST https://photoslibrary.googleapis.com/v1/albums/{albumId}:addEnrichment`\n\nThe URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.\n\n### Path parameters\n\n|Parameters|||\n|-|-|-|\n|`albumId`|`string`|Identifier of the album where the enrichment is to be added.|\n\n### Request body\n\nThe request body contains data with the following structure:\n\nJSON representation\n\n```json\n{\n  \"newEnrichmentItem\": {\n    object (NewEnrichmentItem)\n  },\n  \"albumPosition\": {\n    object (AlbumPosition)\n  }\n}\n```\n\n|Fields|||\n|-|-|-|\n|`newEnrichmentItem`|`object` ([NewEnrichmentItem](https://developers.google.com/photos/library/reference/rest/v1/albums/addEnrichment#NewEnrichmentItem))|The enrichment to be added.|\n|`albumPosition`|`object` ([AlbumPosition](https://developers.google.com/photos/library/reference/rest/v1/AlbumPosition))|The position in the album where the enrichment is to be inserted.|\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\nThe enrichment item that's created.\n\nJSON representation\n\n```json\n{\n  \"enrichmentItem\": {\n    object (EnrichmentItem)\n  }\n}\n```\n\n|Fields|||\n|-|-|-|\n|`enrichmentItem`|`object` ([EnrichmentItem](https://developers.google.com/photos/library/reference/rest/v1/albums/addEnrichment#EnrichmentItem))|Output only. Enrichment which was added.|\n\n### Authorization Scopes\n\nRequires one of the following OAuth scopes:\n\n*   `https://www.googleapis.com/auth/photoslibrary`\n*   `https://www.googleapis.com/auth/photoslibrary.appendonly`\n*   `https://www.googleapis.com/auth/photoslibrary.sharing`\n\nNewEnrichmentItem\n-----------------\n\nA new enrichment item to be added to an album, used by the `albums.addEnrichment` call.\n\nJSON representation\n\n```json\n{\n\n 
  "method": "POST",
  "url": "https://photoslibrary.googleapis.com/v1/albums/{{albumId}}:addEnrichment",
  "queryParams": [],
  "headerData": []
}
Traceback (most recent call last):
  File "/home/seb/.local/lib/python3.11/site-packages/whispers/plugins/json.py", line 27, in pairs
    document = json.loads(document)
               ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Invalid control character at: line 7 column 1968 (char 2095)

Linked to issue: https://github.com/adeptex/whispers/issues/127

adeptex commented 3 months ago

hey @cosad3s, I just released Whispers 2.2.1, this bug should be fixed there.