History

fix: LoginSTS should be an inline implementation (#11337)

STS tokens can be obtained by using local APIs once the remote JWT token is presented, current code was not validating the incoming token in the first place and was incorrectly making a network operation using that token. For the most part this always works without issues, but under adversarial scenarios it exposes client to hand-craft a request that can reach internal services without authentication. This kind of proxying should be avoided before validating the incoming token.

Harshavardhana committed 5 years ago

Commit eb6871e1 parent 9cdd9812 files · +42 −28Browse files

Showing the changes to cmd/api-errors.go (1 of 2 files). Show all

Unified · Split

cmd/api-errors.go+6−0
@@ -2125,6 +2125,12 @@ func toAPIError(ctx context.Context, err error) APIError { · 2124 unmodified lines
21252125 HTTPStatusCode: e.Response().StatusCode,
21262126 }
21272127 // Add more Gateway SDKs here if any in future.
2128+ default:
2129+ apiErr = APIError{
2130+ Code: apiErr.Code,
2131+ Description: fmt.Sprintf("%s: cause(%v)", apiErr.Description, err),
2132+ HTTPStatusCode: apiErr.HTTPStatusCode,
2133+ }
21282134 }
21292135 }
21302136

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t