Skip to content

Read SAML parameters from their binding in the .NET Fedlet; run e2e scripts without a shell - #1139

Open
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fedlet-sample-hardening
Open

vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fedlet-sample-hardening

Conversation

@vharseko

Copy link
Copy Markdown
Member

The .NET Fedlet and e2e cluster of the CodeQL medium triage: cs/web/ambiguous-client-variable ×12, cs/web/directory-browse-enabled ×1, js/indirect-command-line-injection ×1.

The change

  • ServiceProviderUtility.cs read SAMLRequest, SAMLResponse and SAMLart through HttpRequest's indexer (request[name]), which searches QueryString, Form, Cookies and ServerVariables in that order — so a cookie named SAMLResponse could stand in for a posted one. A SAML binding carries the message only in the form of a POST or the query string of a GET; the new GetBindingParameter(request, name) reads it from there and nowhere else, and all 12 reads go through it. GetLogoutRequest already branched on HttpMethod; ProcessSamlResponse and GetLogoutResponse now do so through the helper.
  • SampleApp/Web.config: directoryBrowse off. The sample is what people deploy first.
  • e2e/saml/saml-test.spec.mjs: execSync(\bash "${scriptPath}"`)execFileSync("bash", [scriptPath])` — the path is an argument, not a shell command line.

Left as it is, proposed for dismissal

  • IdentityProviderDiscoveryUtils.cs:171 (cs/web/unvalidated-url-redirection): the redirect target is the circle-of-trust reader-service URL from the Fedlet configuration; only the RelayState query value comes from the request, and that is the request's own URL.

Verification

The Fedlet library compiles with csc against the mono 4.5 framework assemblies (0 errors); node --check on the spec. No Java module is touched.

…cripts without a shell

The Fedlet service-provider utility read SAMLRequest, SAMLResponse and
SAMLart through HttpRequest's indexer, which also searches cookies and
server variables; a SAML binding carries them only in the form of a POST
or the query string of a GET, and GetBindingParameter reads them from
there. The sample application no longer enables directory browsing, and
the SAML e2e spec passes the setup script path to bash as an argument
instead of interpolating it into a shell command line.
@vharseko vharseko added security Security fix or hardening (CVE, GHSA, XSS/CSRF/SSRF) saml SAML / SAML2 federation dotnet Changes to the .NET Fedlet (C# service-provider library and sample) javascript Pull requests that update Javascript code tests Test suite: coverage, fixtures, or test infrastructure labels Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dotnet Changes to the .NET Fedlet (C# service-provider library and sample) javascript Pull requests that update Javascript code saml SAML / SAML2 federation security Security fix or hardening (CVE, GHSA, XSS/CSRF/SSRF) tests Test suite: coverage, fixtures, or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant