Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-1412

JSON strings in some responses not being correctly escaped

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.0
    • 2.7.0
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 75
    • 3

    Description

      Need to ensure strings are correctly escaped when manually building JSON responses (we do this for some small efficiency reasons). We already do this in some places via ConvertToJSONString, need to make sure this is used comprehensively.

      Same general issue as CBG-661, but that fix was too narrow.

      E.g:

      from handler.writeRawJSON, handler.writeRawJSONStatus

      h.writeRawJSON([]byte(`{"id":"` + docid + `","ok":true,"rev":"` + newRev + `"}`)) 

      h.writeRawJSONStatus(http.StatusCreated, []byte(`{"id":"`+docid+`","ok":true,"rev":"`+newRev+`"}`)) 

      Attachments

        Issue Links

          Activity

            People

              isaac.lambat Isaac Lambat
              ben.brooks Ben Brooks
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty