Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const DEFAULT_ALLOWED_REDIRECT_URI_PATTERNS = [
'https://us1.make.celonis.com/oauth/cb/mcp', // Make.com Celonis-hosted (enterprise) — US region
'https://eu1.make.celonis.com/oauth/cb/mcp', // Make.com Celonis-hosted (enterprise) — EU region
'https://replit.com/connectors/oauth/callback', // Replit Agent MCP connector
'https://bolt.new/mcp/oauth/callback', // Bolt.new custom MCP connector
];

// Fail closed: any SET value except an explicit opt-out (false/0/no/off) enables
Expand Down
1 change: 1 addition & 0 deletions test/lib/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const BASELINE_PATTERNS = [
'https://us1.make.celonis.com/oauth/cb/mcp',
'https://eu1.make.celonis.com/oauth/cb/mcp',
'https://replit.com/connectors/oauth/callback',
'https://bolt.new/mcp/oauth/callback',
];

describe('config.uploadDirs', () => {
Expand Down
37 changes: 37 additions & 0 deletions test/lib/oauth-redirect-uri.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const EXACT_CALLBACKS = [
'https://us1.make.celonis.com/oauth/cb/mcp',
'https://eu1.make.celonis.com/oauth/cb/mcp',
'https://replit.com/connectors/oauth/callback',
'https://bolt.new/mcp/oauth/callback',
];

const WILDCARD_CALLBACKS = [
Expand Down Expand Up @@ -59,6 +60,13 @@ const LOOKALIKE_CALLBACKS = [
'https://replit.com/connectors/oauth/callback?next=evil',
'http://replit.com/connectors/oauth/callback',
'https://connectors.replit.com/connect/callback',
'https://boltxnew/mcp/oauth/callback',
'https://bolt.new.evil.example/mcp/oauth/callback',
'https://evil.bolt.new/mcp/oauth/callback',
'https://bolt.new/mcp/oauth/callback/',
'https://bolt.new/mcp/oauth/callback?next=evil',
'http://bolt.new/mcp/oauth/callback',
'https://bolt.new/mcp/oauth/other',
];

const LOOPBACK_CONFUSION_CALLBACKS = [
Expand Down Expand Up @@ -778,6 +786,35 @@ describe('Browserless OAuth redirect URI validation', () => {
}
});

it("registers Bolt's connector callback and authorizes it", async () => {
const proxy = new BrowserlessOAuthProxy(buildConfig());
const redirectUri = 'https://bolt.new/mcp/oauth/callback';
try {
const registration = await proxy.registerClient({
redirect_uris: [redirectUri],
token_endpoint_auth_method: 'none',
grant_types: ['authorization_code', 'refresh_token'],
response_types: ['code'],
});
expect(registration.redirect_uris).to.deep.equal([redirectUri]);
const response = await proxy.authorize({
client_id: registration.client_id,
redirect_uri: redirectUri,
response_type: 'code',
code_challenge: 'pEBxCafD9QGkNN6MEtL_JBmM8tP-5jcOlDwInA2IYdc',
code_challenge_method: 'S256',
resource: 'http://127.0.0.1:18081/mcp',
state: 'bolt-state',
});
expect(response.status).to.equal(302);
expect(response.headers.get('location')).to.include(
'127.0.0.1:9/oauth/authorize',
);
} finally {
proxy.destroy();
}
});

it('does not persist a mixed valid and unsafe redirect list', async () => {
const redis = new RedisMock() as unknown as Redis;
const proxy = new BrowserlessOAuthProxy({
Expand Down
Loading