Skip to main content
Glama

security.test_auth_bypass

Test authentication bypass vulnerabilities by analyzing protected endpoints to identify security gaps in access controls.

Instructions

Test for authentication bypass vulnerabilities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesProtected endpoint URL
methodNoGET

Implementation Reference

  • Registration of the 'security.test_auth_bypass' tool using server.tool(), including inline schema and handler function.
    server.tool(
      'security.test_auth_bypass',
      {
        description: 'Test for authentication bypass vulnerabilities',
        inputSchema: {
          type: 'object',
          properties: {
            url: { type: 'string', description: 'Protected endpoint URL' },
            method: {
              type: 'string',
              enum: ['GET', 'POST', 'PUT', 'DELETE'],
              default: 'GET',
            },
          },
          required: ['url'],
        },
      },
      async ({ url, method = 'GET' }: any): Promise<ToolResult> => {
        try {
          const bypassAttempts = [
            { headers: {} }, // No auth
            { headers: { 'X-Forwarded-For': '127.0.0.1' } },
            { headers: { 'X-Original-IP': '127.0.0.1' } },
            { headers: { 'X-Real-IP': '127.0.0.1' } },
            { headers: { 'Authorization': 'Bearer null' } },
            { headers: { 'Authorization': 'Bearer undefined' } },
          ];
    
          const results: any[] = [];
    
          for (const attempt of bypassAttempts) {
            try {
              const config: any = {
                url,
                method: method.toLowerCase(),
                validateStatus: () => true,
                timeout: 15000,
                headers: {
                  'User-Agent': 'Mozilla/5.0',
                  ...attempt.headers,
                },
              };
    
              const response = await axios(config);
    
              const result = {
                attempt: attempt.headers,
                status: response.status,
                accessible: response.status === 200,
                bodyLength: typeof response.data === 'string'
                  ? response.data.length
                  : JSON.stringify(response.data).length,
              };
    
              if (result.accessible) {
                await saveFinding({
                  target: url,
                  type: 'Auth Bypass',
                  severity: 'critical',
                  description: `Potential auth bypass - accessible without proper authentication`,
                  payload: JSON.stringify(attempt.headers),
                  response: typeof response.data === 'string'
                    ? response.data.substring(0, 1000)
                    : JSON.stringify(response.data).substring(0, 1000),
                  timestamp: new Date(),
                  score: 9,
                });
              }
    
              results.push(result);
            } catch (error: any) {
              results.push({
                attempt: attempt.headers,
                error: error.message,
              });
            }
          }
    
          const authScore = results.some((r: any) => r.vulnerable) ? 9 : 4;
          await saveTestResult(url, 'auth_bypass_test', true, { results }, undefined, authScore, method, JSON.stringify(results));
    
          return formatToolResult(true, {
            results,
            summary: {
              totalTests: bypassAttempts.length,
              accessible: results.filter((r) => r.accessible).length,
            },
          });
        } catch (error: any) {
          await saveTestResult(url, 'auth_bypass_test', false, null, error.message, 0, method, undefined);
          return formatToolResult(false, null, error.message);
        }
      }
    );
  • The core handler function that executes authentication bypass tests by attempting various header manipulations (e.g., IP spoofing, null tokens) and checking if the endpoint responds with 200 OK without authentication. Saves findings if vulnerable.
    async ({ url, method = 'GET' }: any): Promise<ToolResult> => {
      try {
        const bypassAttempts = [
          { headers: {} }, // No auth
          { headers: { 'X-Forwarded-For': '127.0.0.1' } },
          { headers: { 'X-Original-IP': '127.0.0.1' } },
          { headers: { 'X-Real-IP': '127.0.0.1' } },
          { headers: { 'Authorization': 'Bearer null' } },
          { headers: { 'Authorization': 'Bearer undefined' } },
        ];
    
        const results: any[] = [];
    
        for (const attempt of bypassAttempts) {
          try {
            const config: any = {
              url,
              method: method.toLowerCase(),
              validateStatus: () => true,
              timeout: 15000,
              headers: {
                'User-Agent': 'Mozilla/5.0',
                ...attempt.headers,
              },
            };
    
            const response = await axios(config);
    
            const result = {
              attempt: attempt.headers,
              status: response.status,
              accessible: response.status === 200,
              bodyLength: typeof response.data === 'string'
                ? response.data.length
                : JSON.stringify(response.data).length,
            };
    
            if (result.accessible) {
              await saveFinding({
                target: url,
                type: 'Auth Bypass',
                severity: 'critical',
                description: `Potential auth bypass - accessible without proper authentication`,
                payload: JSON.stringify(attempt.headers),
                response: typeof response.data === 'string'
                  ? response.data.substring(0, 1000)
                  : JSON.stringify(response.data).substring(0, 1000),
                timestamp: new Date(),
                score: 9,
              });
            }
    
            results.push(result);
          } catch (error: any) {
            results.push({
              attempt: attempt.headers,
              error: error.message,
            });
          }
        }
    
        const authScore = results.some((r: any) => r.vulnerable) ? 9 : 4;
        await saveTestResult(url, 'auth_bypass_test', true, { results }, undefined, authScore, method, JSON.stringify(results));
    
        return formatToolResult(true, {
          results,
          summary: {
            totalTests: bypassAttempts.length,
            accessible: results.filter((r) => r.accessible).length,
          },
        });
      } catch (error: any) {
        await saveTestResult(url, 'auth_bypass_test', false, null, error.message, 0, method, undefined);
        return formatToolResult(false, null, error.message);
      }
    }
  • Input schema defining the parameters for the tool: required 'url' of the protected endpoint and optional 'method' (GET/POST/PUT/DELETE).
    {
      description: 'Test for authentication bypass vulnerabilities',
      inputSchema: {
        type: 'object',
        properties: {
          url: { type: 'string', description: 'Protected endpoint URL' },
          method: {
            type: 'string',
            enum: ['GET', 'POST', 'PUT', 'DELETE'],
            default: 'GET',
          },
        },
        required: ['url'],
      },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Test for authentication bypass vulnerabilities' implies this performs potentially intrusive security testing, but doesn't specify whether it's passive or active, what permissions are needed, what side effects it might have, or what the output looks like. For a security testing tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for what it communicates, though it could benefit from additional context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a security testing tool with 2 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool actually does (how it tests), what results to expect, or provide enough context for safe and effective use. The agent would need to guess about the tool's behavior and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50% (only the 'url' parameter has a description). The tool description doesn't mention any parameters or provide additional context about what the 'method' parameter means in the context of authentication bypass testing. The description doesn't compensate for the 50% coverage gap, so it meets the baseline but doesn't add value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Test for authentication bypass vulnerabilities' states the general purpose (testing for a specific security vulnerability) but lacks specificity about what resource or system it acts upon. It doesn't distinguish from sibling tools like security.test_csp or security.test_xss beyond the vulnerability type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, target contexts, or when other security testing tools might be more appropriate. It simply states what the tool does without usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/telmon95/VulneraMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server