Compare commits

...

9 Commits

Author SHA1 Message Date
dependabot[bot]
e7decf9bbe Bump System.Threading.Channels from 10.0.3 to 10.0.10
---
updated-dependencies:
- dependency-name: System.Threading.Channels
  dependency-version: 10.0.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-29 12:18:28 +00:00
dependabot[bot]
b8dd9a3e3c Bump System.Formats.Asn1 and System.Security.Cryptography.Pkcs (#4584)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Salman Chishti <salmanmkc@GitHub.com>
2026-07-29 12:14:51 +00:00
dependabot[bot]
cc01a0d090 Bump undici from 6.24.1 to 6.27.0 in /src/Misc/expressionFunc/hashFiles (#4522)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Salman Chishti <salmanmkc@GitHub.com>
2026-07-29 13:06:16 +01:00
dependabot[bot]
03a0707cbe Bump @typescript-eslint/parser from 8.63.0 to 8.65.0 in /src/Misc/expressionFunc/hashFiles (#4582)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-29 11:23:54 +01:00
Francesco Renzi
e1d1844725 Mask and sanitize debugger welcome message before DAP console output (#4577) 2026-07-28 11:31:59 +00:00
dependabot[bot]
44b796f3c8 Bump @typescript-eslint/parser from 8.59.0 to 8.63.0 in /src/Misc/expressionFunc/hashFiles (#4543)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Salman Chishti <salmanmkc@GitHub.com>
2026-07-28 12:01:20 +01:00
dependabot[bot]
6bb3178b59 Bump eslint-plugin-github from 4.10.2 to 6.1.0 in /src/Misc/expressionFunc/hashFiles (#4549)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Salman Chishti <salmanmkc@GitHub.com>
2026-07-28 11:27:28 +01:00
dependabot[bot]
148a3bb616 Bump Microsoft.DevTunnels.Connections from 1.3.48 to 1.3.50 (#4566)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Salman Chishti <salmanmkc@GitHub.com>
2026-07-28 11:22:36 +01:00
dependabot[bot]
e18d1a9845 Bump actions/stale from 10 to 11 (#4576)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-28 11:21:36 +01:00
12 changed files with 3012 additions and 2594 deletions

View File

@@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v10
- uses: actions/stale@v11
with:
close-issue-message: "This issue does not seem to be a problem with the runner application, it concerns the GitHub actions platform more generally. Could you please post your feedback on the [GitHub Community Support Forum](https://github.com/orgs/community/discussions/categories/actions) which is actively monitored. Using the forum ensures that we route your problem to the correct team. 😃"
exempt-issue-labels: "keep"

View File

@@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v10
- uses: actions/stale@v11
with:
close-issue-message: "Thank you for your interest in the runner application and taking the time to provide your valuable feedback. We kindly ask you to redirect this feedback to the [GitHub Community Support Forum](https://github.com/orgs/community/discussions/categories/actions) which our team actively monitors and would be a better place to start a discussion for new feature requests in GitHub Actions. For more information on this policy please [read our contribution guidelines](https://github.com/actions/runner#contribute). 😃"
exempt-issue-labels: "keep"

View File

@@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v10
- uses: actions/stale@v11
with:
stale-issue-message: "This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 15 days."
close-issue-message: "This issue was closed because it has been stalled for 15 days with no activity."

File diff suppressed because it is too large Load Diff

View File

@@ -38,10 +38,10 @@
"@stylistic/eslint-plugin": "^5.10.0",
"@types/node": "^22.0.0",
"@typescript-eslint/eslint-plugin": "^8.59.0",
"@typescript-eslint/parser": "^8.59.0",
"@typescript-eslint/parser": "^8.65.0",
"@vercel/ncc": "^0.38.3",
"eslint": "^8.47.0",
"eslint-plugin-github": "^4.10.2",
"eslint-plugin-github": "^6.1.0",
"eslint-plugin-prettier": "^5.0.0",
"husky": "^9.1.7",
"lint-staged": "^16.4.0",

View File

@@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="System.Text.Encoding.CodePages" Version="10.0.3" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="System.Threading.Channels" Version="10.0.3" />
<PackageReference Include="System.Threading.Channels" Version="10.0.10" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">

View File

@@ -1026,7 +1026,9 @@ namespace GitHub.Runner.Worker.Dap
{
if (!string.IsNullOrEmpty(debuggerConfig.WelcomeMessage))
{
SendOutput("console", debuggerConfig.WelcomeMessage);
// The welcome message is server-supplied and never rendered verbatim:
// mask secrets and strip control characters before it reaches the console.
SendOutput("console", SanitizeConsoleText(MaskUserVisibleText(debuggerConfig.WelcomeMessage)));
Trace.Info("Sent custom welcome message");
}
else
@@ -1772,6 +1774,30 @@ namespace GitHub.Runner.Worker.Dap
return HostContext?.SecretMasker?.MaskSecrets(value) ?? value;
}
/// <summary>
/// Removes C0/C1 control characters (except tab, carriage return and line feed) so
/// server-supplied text cannot inject ANSI escape sequences or terminal control codes
/// into the DAP console.
/// </summary>
internal static string SanitizeConsoleText(string value)
{
if (string.IsNullOrEmpty(value))
{
return value ?? string.Empty;
}
var builder = new StringBuilder(value.Length);
foreach (var character in value)
{
if (!char.IsControl(character) || character == '\t' || character == '\r' || character == '\n')
{
builder.Append(character);
}
}
return builder.ToString();
}
/// <summary>
/// Creates a DAP response with common fields pre-populated.
/// </summary>

View File

@@ -36,6 +36,11 @@ namespace GitHub.Runner.Worker.Dap
/// Optional welcome message content for the debugger console. Only used when
/// <see cref="OverrideWelcomeMessage"/> is true.
/// </summary>
/// <remarks>
/// Server-supplied and treated as untrusted: it is masked with the runner's
/// secret masker and stripped of control characters before being written to
/// the debugger console.
/// </remarks>
public string WelcomeMessage { get; }
/// <summary>Whether the tunnel configuration is complete and valid.</summary>

View File

@@ -23,7 +23,7 @@
<PackageReference Include="System.ServiceProcess.ServiceController" Version="10.0.3" />
<PackageReference Include="System.Threading.Channels" Version="10.0.3" />
<PackageReference Include="YamlDotNet.Signed" Version="5.3.0" />
<PackageReference Include="Microsoft.DevTunnels.Connections" Version="1.3.48" />
<PackageReference Include="Microsoft.DevTunnels.Connections" Version="1.3.50" />
</ItemGroup>
<ItemGroup>

View File

@@ -271,7 +271,7 @@ namespace GitHub.DistributedTask.Pipelines
/// Optional welcome message shown in the debugger console when a client connects.
/// Only used when the <c>actions_runner_override_debugger_welcome_message</c>
/// feature flag is set to <c>true</c> in the job variables. With the flag set,
/// a non-empty value is shown as-is and a null or empty value suppresses the
/// a non-empty value is shown and a null or empty value suppresses the
/// default welcome message. When the flag is not set, the runner shows its
/// built-in help text and this field is ignored.
/// </summary>

View File

@@ -23,14 +23,14 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.7" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.10" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="10.0.3" />
<PackageReference Include="Minimatch" Version="2.0.0" />
<PackageReference Include="YamlDotNet.Signed" Version="5.3.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
<PackageReference Include="System.Formats.Asn1" Version="10.0.7" />
<PackageReference Include="System.Formats.Asn1" Version="10.0.10" />
</ItemGroup>
<ItemGroup>

View File

@@ -1422,6 +1422,96 @@ namespace GitHub.Runner.Common.Tests.Worker
}
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]
public async Task WelcomeMessageMasksSecrets()
{
using (var hc = CreateTestContext())
{
hc.SecretMasker.AddValue("super-secret-token");
var port = GetFreePort();
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
var jobContext = CreateJobContextWithTunnel(cts.Token, port,
overrideWelcomeMessage: true,
welcomeMessage: "Welcome! Token: super-secret-token");
await _debugger.StartAsync(jobContext.Object);
using var client = await ConnectClientAsync(port);
var stream = client.GetStream();
await SendRequestAsync(stream, new Request
{
Seq = 1,
Type = "request",
Command = "configurationDone"
});
var configDoneResponse = await ReadDapMessageAsync(stream, TimeSpan.FromSeconds(5));
Assert.Contains("\"command\":\"configurationDone\"", configDoneResponse);
var welcomeMsg = await ReadDapMessageAsync(stream, TimeSpan.FromSeconds(5));
Assert.Contains("\"event\":\"output\"", welcomeMsg);
Assert.DoesNotContain("super-secret-token", welcomeMsg);
Assert.Contains("***", welcomeMsg);
await _debugger.StopAsync();
}
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]
public async Task WelcomeMessageStripsControlCharacters()
{
using (CreateTestContext())
{
var port = GetFreePort();
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
var jobContext = CreateJobContextWithTunnel(cts.Token, port,
overrideWelcomeMessage: true,
welcomeMessage: "Wel\u001b[31mcome\u0007\u0000\u009bhere\nnext\tline");
await _debugger.StartAsync(jobContext.Object);
using var client = await ConnectClientAsync(port);
var stream = client.GetStream();
await SendRequestAsync(stream, new Request
{
Seq = 1,
Type = "request",
Command = "configurationDone"
});
var configDoneResponse = await ReadDapMessageAsync(stream, TimeSpan.FromSeconds(5));
Assert.Contains("\"command\":\"configurationDone\"", configDoneResponse);
var welcomeMsg = await ReadDapMessageAsync(stream, TimeSpan.FromSeconds(5));
Assert.Contains("\"event\":\"output\"", welcomeMsg);
var output = JObject.Parse(welcomeMsg)["body"]["output"].ToString();
Assert.Equal("Wel[31mcomehere\nnext\tline", output);
await _debugger.StopAsync();
}
}
[Theory]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]
[InlineData(null, "")]
[InlineData("", "")]
[InlineData("plain text", "plain text")]
[InlineData("keep\r\nnewlines\tand tabs", "keep\r\nnewlines\tand tabs")]
[InlineData("esc\u001bape", "escape")]
[InlineData("bell\u0007null\u0000del\u007f", "bellnulldel")]
[InlineData("c1\u0080\u009fchars", "c1chars")]
public void SanitizeConsoleTextRemovesControlCharacters(string input, string expected)
{
Assert.Equal(expected, DapDebugger.SanitizeConsoleText(input));
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]