Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Security issue: recording query params insecure (tokens) #1285

Open
@codyaray

Description

What version of OpenCensus are you using?

go.opencensus.io v0.23.0

What version of Go are you using?

Varies between services, but ranges from 1.16 to 1.18 mostly

What did you do?

With a service that uses ochttp, made an HTTP request with a secret in the query param, and check the http.url span

What did you expect to see?

Ideally we wouldn't have the secret logged at all. In this case, that means no http.url span... just the http.path span.

(Obviously the implicit assumption here is that all secrets must be in query params rather than paths)

What did you see instead?

I could see the secret, in all its glory

Additional context

Normally I agree about avoiding secrets in URLs entirely (path or query), but one of the most common usages is tokens for email validation, password resets, and similar which are click-through from emails. Unfortunately, emails can't add custom HTTP headers so this means that the token has to be in the URL. And yes, though these are generally considered one-time tokens, any issue could mean we can't guarantee that there will never be an error response returned without marking the token as invalidated.

So to be on the safe side our security team is demanding that we remove this parameter.

Now that leaves us with a few options:

  1. fork this library just to remove this ourselves - obviously we'd like to stay on upstream
  2. use the IsHealthEndpoint as a hack to disable tracing for these endpoints - but then we lose observability into common workflows (e.g., password resets, email validation, user signup, etc)
  3. add some sort of thing between the services and the eventual destination (DataDog in our case) that can remove these attributes from all spans.
  4. see if we can get this change made in the core ochttp plugin and bump our versions - this issue :)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions