sts: build_sts_error_response writes caller-controlled text into XML unescaped
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start at multistore_sts::build_sts_error_response and trace the STS route mounted by Router::with_sts. Check how caller-controlled message values reach the XML body, then ensure the generated application/xml remains escaped and parseable for the listed error paths. Done means special characters in role ARNs, key IDs, and echoed header fields cannot create markup or malformed XML.
Written by the indexing model from the issue text.
Description
multistore_sts::build_sts_error_response interpolates the error message into the <Message> element unescaped:
let xml = format!("...<Code>{}</Code><Message>{}</Message>...", code, message);
Several messages carry caller-controlled text:
ProxyError::RoleNotFound(role_arn)→role not found: {role_arn}find_key→key '{kid}' not found in JWKS, wherekidcomes from the unverified JWT headerverify_tokenerrors that echo header fields such asalg
The body is served as application/xml. A host's CORS layer may add access-control-allow-origin: *.
Impact:
- Script injection: a
RoleArnsuch as<x:script xmlns:x="http://www.w3.org/1999/xhtml">alert(document.domain)</x:script>returns a document that browsers render as XHTML, running script on the proxy's origin. - Unparseable errors: any
&in aRoleArnmakes the error body malformed XML, so SDKs fail to parse it.
This is reachable through the STS route that Router::with_sts mounts. A host can escape errors it builds itself, but not this route's.
Suggested fix: escape &, < and > (and " if attributes are ever added) in message before formatting. The Code values are fixed strings.
Found in review of source-cooperative/data.source.coop#237. Its own exchange paths now build escaped bodies (source-cooperative/data.source.coop#246); the person route still goes through this builder.
- Dominant language
- Rust
- Stars
- 21
- Forks
- 1
- Avg merge
- 16h 39m
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developmentseed/multistore
-
Support UploadPartCopy (multipart server-side copy): AWS CLI and boto3 use it for any copy over 8 MBOpenenhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
developmentseed/multistore#168 ·
-
List of a prefix 503s when a single object key contains an empty path segment (//)Possibly taken @alukach claimed this 127 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
developmentseed/multistore#116 · 1 comment ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 68/100
-
oidc-provider: optional `oidc_session_name` backend-option to override RoleSessionName derivationOpen
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Credential cache key (role ARN) doesn't capture the full minted identity (subject + extra_claims)Open
Difficulty 4/5 3-5 days Newbie friendliness 55/100
All issues in developmentseed/multistore
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
storytold/craft-anything#2472 ·
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsotto/sotto-authenticator#68 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
slavakurilyak/awesome-ai-agents#1046 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nowledge-co/hawdb#1995 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
swc-project/swc-next-issues#984 ·