Shopify / Shopify/toxiproxy

Toxiproxy API access from browser

Open
#219 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug security
Dominant language
Go
Stars
12.4k
Forks
510
PR merge metrics
No merged PRs in 30d

Description

This was previously "fixed" in PR https://github.com/Shopify/toxiproxy/pull/184, but it looks like it is still possible to access Toxiproxy from a malicious page.

I was looking deeper into this, and the User-Agent header is programmable via JS.
See: https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name

Generally this means a malicious page can make requests from the user's IP. The Host header can't be set, so this isn't terribly useful to an attacker, but there's still definitely DOS possibilities, and issues around unsecured internal endpoints.

I think the main thing that needs to happen is to lock down and verify the hostname requests are being sent to. 127.0.0.1 and localhost should be safe, but we should disallow requests to other hostnames unless explicitly set when starting the service.

CC-ing people on the original PR/issue:
@JackMc @jpittis @sirupsen @EiNSTeiN-

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Trace the browser-facing API and service-startup configuration, then inspect how request hostnames are accepted and validated. Done means browser-originated requests cannot reach non-approved hostnames, while localhost, 127.0.0.1, and explicitly configured hosts remain supported; add coverage for those cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.