Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
d2bb4c2
add 2 templats for mcp
nayanakto Jul 11, 2025
3775a59
add few more templates
nayanakto Jul 11, 2025
772bbaf
add more test templates
nayanakto Jul 11, 2025
ed07430
add mcp response data leak check test template
nayanakto Jul 11, 2025
dd9f84b
changes
nayanakto Jul 11, 2025
dbdf305
change plan to PRO
nayanakto Jul 11, 2025
ef6436d
changes in prompts
nayanakto Jul 11, 2025
0a2ad49
add dos templates
nayanakto Jul 14, 2025
dbdbade
add auth scheme template
nayanakto Jul 14, 2025
74a7c9d
contextual changes
nayanakto Jul 14, 2025
4b31726
add one more template
nayanakto Jul 14, 2025
3491fb3
rename
nayanakto Jul 14, 2025
5e3a6c8
add MCP prefix
nayanakto Jul 14, 2025
dbd726c
delete duplicate file
nayanakto Jul 14, 2025
a824c93
remove unwanted line
nayanakto Jul 16, 2025
07d5ead
pr comments
nayanakto Jul 16, 2025
ca63fd4
changes
nayanakto Jul 16, 2025
eaa7779
changes in auth and json method not supported template
nayanakto Jul 17, 2025
1392323
add contextual prompt for MCP method and version related tests
nayanakto Jul 17, 2025
c885eb5
add contextual prompt
nayanakto Jul 17, 2025
7747f5b
fix error
nayanakto Jul 17, 2025
e495a15
add command injection test
nayanakto Jul 17, 2025
9e20c7e
added mcp test cases related to error handling and resources
krngrover94 Jul 17, 2025
ca4e007
change severity
nayanakto Jul 17, 2025
1c0468f
add tool poisoning template
nayanakto Jul 17, 2025
1c0e99d
add remediation steps
nayanakto Jul 21, 2025
cd5e925
change name and subcategory
nayanakto Jul 21, 2025
27cfbf1
add mcp tpa test templates
nayanakto Jul 21, 2025
16bb80d
changes
nayanakto Jul 22, 2025
d2bb6c3
changes
nayanakto Jul 23, 2025
c24dfe6
changes in category name
nayanakto Jul 23, 2025
f96b3af
fix regex
nayanakto Jul 23, 2025
6da07a7
add command injection tests
krngrover94 Jul 23, 2025
645c6ee
add retry loop tests
nayanakto Jul 28, 2025
251d96b
added 2 tests mcp llm
krngrover94 Jul 28, 2025
9dcb3bc
add comand
nayanakto Jul 28, 2025
025f16c
added 2 test cases
krngrover94 Jul 28, 2025
22e00f5
Merge remote-tracking branch 'origin/mcp-pro' into mcp-pro
nayanakto Jul 28, 2025
acaaf99
Merge branch 'pro' of github.com:akto-api-security/tests-library into…
krngrover94 Jul 29, 2025
bc25643
fixed mcp test cases issue in PR
krngrover94 Jul 29, 2025
b74b374
add command injection tests
nayanakto Jul 30, 2025
f564123
fix template
nayanakto Jul 30, 2025
2560ce2
fix more
nayanakto Jul 30, 2025
5f10a48
temp - changed category
nayanakto Jul 30, 2025
09c2831
fix dos test
nayanakto Jul 31, 2025
842b30e
fix auth template
nayanakto Aug 4, 2025
ce60351
fix displayName
nayanakto Aug 4, 2025
59fc04c
add dns rebinding attack template
nayanakto Aug 4, 2025
115583f
added few generic llm tests
nayanakto Aug 5, 2025
f1161c8
add new tests
nayanakto Aug 5, 2025
fc0ccf8
add references
nayanakto Aug 6, 2025
b902aa2
fixed mcp test cases
krngrover94 Aug 6, 2025
d00c143
add more test cases
nayanakto Aug 6, 2025
f344c5f
add more tests
nayanakto Aug 6, 2025
a43e6dd
add more tests
nayanakto Aug 6, 2025
9cbc90b
fix rephrase prompt
nayanakto Aug 6, 2025
a89f2ca
LLM compliance tests
nayanakto Aug 7, 2025
36e325d
fix authentication test case
krngrover94 Aug 11, 2025
a06f433
fix regex and file deletion issue
krngrover94 Aug 11, 2025
78b6938
Merge branch 'mcp-pro' of github.com:akto-api-security/tests-library …
krngrover94 Aug 11, 2025
6660fc9
Merge pull request #205 from akto-api-security/mcp-pro-addons
krngrover94 Aug 11, 2025
879917e
add test
nayanakto Aug 11, 2025
4deb288
add tests
nayanakto Aug 11, 2025
dcefd8a
changes in tests
nayanakto Aug 11, 2025
638c17f
rename cmd injection category
nayanakto Aug 18, 2025
c9e698f
modify tests
nayanakto Aug 20, 2025
049f5fd
add magic validate
nayanakto Aug 20, 2025
275bf72
add unhandled error disclosure test
nayanakto Aug 21, 2025
82316f6
add indirection prompt injection
nayanakto Aug 21, 2025
d6c5856
fix test
nayanakto Aug 21, 2025
f8b2e69
changes
nayanakto Aug 21, 2025
3417178
rename shortName
nayanakto Aug 21, 2025
aa41d89
add more tests
nayanakto Aug 21, 2025
65a2c04
add file path related tests
nayanakto Aug 22, 2025
418bb2e
remove non mcp tests
nayanakto Aug 22, 2025
c1aa9bc
fix test template
nayanakto Aug 22, 2025
d27c7d0
chnages in tests
nayanakto Aug 24, 2025
6a8c9e8
fix test issues for error scenarios
nayanakto Aug 24, 2025
e0cd7f9
remove duplicate test
nayanakto Aug 24, 2025
dfe2c9f
remove one more duplicate test template
nayanakto Aug 24, 2025
2e01004
temp deactivate duplicate test
nayanakto Aug 24, 2025
8aec1f1
changes
nayanakto Aug 25, 2025
c8b5d91
modify prompt
nayanakto Aug 25, 2025
ed95f06
changes
nayanakto Aug 25, 2025
4b06a33
add more strict validations
nayanakto Aug 25, 2025
1eff02a
fix test cases
nayanakto Aug 27, 2025
d7e6094
minor changes
nayanakto Aug 27, 2025
6816861
fix
nayanakto Aug 27, 2025
61aab35
add tools/list check
nayanakto Aug 27, 2025
5bb38e8
changes in mcp method related test
nayanakto Aug 27, 2025
bbf75a5
fix tests
nayanakto Aug 27, 2025
d13030a
use not contains either
nayanakto Aug 27, 2025
4ea3b52
changes
nayanakto Aug 27, 2025
12f3636
comment llm validation
nayanakto Aug 27, 2025
fcf9f70
add magic validate
nayanakto Aug 27, 2025
ee166fd
minor changes
nayanakto Aug 27, 2025
27e163e
fix error
nayanakto Aug 27, 2025
4f894bc
fix
nayanakto Aug 27, 2025
bd96ba9
fix indirect prompt injection tests
nayanakto Aug 27, 2025
d4ff61a
add more tests
nayanakto Aug 27, 2025
52fa099
fix sensitive data test
nayanakto Aug 27, 2025
dc9f3a0
changes in prompt indirection tests
nayanakto Aug 28, 2025
9bbe955
fix display name in llm test cases
krngrover94 Sep 11, 2025
6787070
make all_apis inactive
shivam-rawat-akto Oct 16, 2025
6202788
function, ping and token passthrough tests
shivam-rawat-akto Oct 21, 2025
25d16c9
function, ping and token passthrough tests
shivam-rawat-akto Oct 22, 2025
f4a9c6d
MCP function call templates final
shivam-rawat-akto Oct 22, 2025
fba7c1e
fix templates
shivam-rawat-akto Oct 24, 2025
4c09c07
added remaining templates
shivam-rawat-akto Oct 30, 2025
0e4801b
Merge pull request #239 from akto-api-security/feature/mcp-templates-…
shivam-rawat-akto Oct 31, 2025
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
61 changes: 61 additions & 0 deletions MCP-Security/MCPAuthenticationByChangingAuthScheme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
id: AUTHENTICATION_WITH_WRONG_AUTH_SCHEME_MCP
info:
name: Authentication with Wrong Authorization Scheme (MCP)
description: |
This test checks whether the MCP server strictly enforces the use of the expected authorization scheme.
details: |
The request modifies the Authorization header to use the "Basic" scheme instead of the expected "Bearer" scheme. If the server accepts this modification, it indicates weak authentication enforcement.
impact: |
Accepting requests with the wrong authorization scheme may allow bypassing intended authentication mechanisms or introduce unexpected behavior.
category:
name: MCP_AUTH
shortName: MCP_AUTH
displayName: Model Context Protocol (MCP) Security - Broken Authentication
subCategory: AUTHENTICATION_WITH_WRONG_AUTH_SCHEME_MCP
severity: HIGH
tags:
- Authentication
- OWASP top 10
- Business logic
references:
- https://portswigger.net/web-security/authentication
- https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
cwe:
- CWE-287
cve:
- CVE-2023-27997
attributes:
nature: INTRUSIVE
plan: PRO
duration: FAST
api_selection_filters:
response_code:
gte: 200
lt: 300
method:
eq: POST
request_payload:
contains_all:
- jsonrpc
- method
- params
request_headers:
for_one:
key:
regex: .*
extract: authHeaderKey
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add regex for Authorization key

value:
regex: ^Bearer.*
extract: authHeaderVal
execute:
type: single
requests:
- req:
- modify_header:
authHeaderKey: "Basic ${authHeaderVal}"
validate:
response_code:
gte: 401
response_payload:
contains_either: "$magic Check whether the response contains any kind of error response (error status, error fields, error messages, error flags or any json key related to error) related to authentication failure. If there is any error then return nothing just empty braces []. Else return a list of words from the response only in case of successful response."
57 changes: 57 additions & 0 deletions MCP-Security/MCPAuthenticationTokenReflectionInResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
id: AUTHENTICATION_TOKEN_REFLECTION_IN_RESPONSE_MCP
info:
name: Authenticaton Token Reflection in Response (MCP)
description: |
This test verifies whether the access token provided in the Authorization header is echoed back in the server's response.
details: |
Reflecting sensitive tokens in the response increases the risk of token leakage through logs, error messages, or intermediate systems. This test sends a valid token and observes whether it is reflected back in the response body.
impact: |
Token reflection can lead to credential exposure, log injection, or unintended propagation of secrets, especially if the server response is cached or logged.
category:
name: MCP_AUTH
shortName: MCP_AUTH
displayName: Model Context Protocol (MCP) Security - Broken Authentication
subCategory: AUTHENTICATION_TOKEN_REFLECTION_IN_RESPONSE_MCP
severity: HIGH
tags:
- Authentication
- Token reflection
- OWASP top 10
- Business logic
references:
- https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
- https://owasp.org/www-community/attacks/Information_exposure_through_query_strings_in_url
cwe:
- CWE-200
cve:
- CVE-2023-1644
attributes:
nature: INTRUSIVE
plan: PRO
duration: FAST
api_selection_filters:
response_code:
gte: 200
lt: 300
method:
eq: POST
request_payload:
contains_all:
- jsonrpc
- method
- params
request_headers:
for_one:
key:
contains_either: "$magic From the request headers, find the key that contains the authorization information. It must contain the access token or credentials used for authentication. Return only the header key name."
extract: authHeaderKey
value:
extract: authHeaderVal
execute:
type: single
requests:
- req: []
validate:
response_payload:
contains_either: "$magic Check whether the response body contains the authentication token value that was passed in the request header (the heder value: ${authHeaderVal}). If there is no exact token matching, then return just empty braces. Else return a list with the exact token found in the response."
58 changes: 58 additions & 0 deletions MCP-Security/MCPAuthenticationTokenReflectionInResponseHeaders.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
id: AUTHENTICATION_TOKEN_REFLECTION_IN_HEADERS_MCP
info:
name: Authentication Token Reflection in Response Headers (MCP)
description: |
This test verifies whether the access token provided in the Authorization header is echoed back in the server's response headers.
details: |
Reflecting sensitive tokens in response headers poses a serious risk of credential leakage via logs, proxies, caches, or browser access.
This test modifies the access token with a unique marker and inspects response headers for reflection.
impact: |
Tokens exposed in response headers can be intercepted or logged unintentionally, increasing the risk of unauthorized access and session hijacking.
category:
name: MCP_AUTH
shortName: MCP_AUTH
displayName: Model Context Protocol (MCP) Security - Broken Authentication
subCategory: AUTHENTICATION_TOKEN_REFLECTION_IN_HEADERS_MCP
severity: HIGH
tags:
- Authentication
- Token leakage
- Business logic
- OWASP top 10
references:
- https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
- https://owasp.org/www-community/attacks/Information_exposure_through_response_headers
cwe:
- CWE-200
cve:
- CVE-2023-1644
attributes:
nature: INTRUSIVE
plan: PRO
duration: FAST
api_selection_filters:
response_code:
gte: 200
lt: 300
method:
eq: POST
request_payload:
contains_all:
- jsonrpc
- method
- params
request_headers:
for_one:
key:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets discuss this

contains_either: "$magic From the request headers, find the key that holds the authorization token. This will typically contain access credentials. Return only the header key name."
extract: authHeaderKey
value:
extract: authHeaderVal
execute:
type: single
requests:
- req: []
validate:
response_headers:
contains_either: "$magic Check whether the response headers contains any authentication token value that was passed in the request header (the heder value: ${authHeaderVal}). If there is no exact token matching, then return just empty braces. Else return a list of words with the actual token found in the response header only."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heder - spell check

130 changes: 130 additions & 0 deletions MCP-Security/MCPBreakingJsonParsing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
id: MCP_BREAKING_JSON_PARSING
info:
name: Breaking JSON Parsing (MCP)
description: "This test checks whether MCP servers robustly handle unexpected or control characters in JSON input. It evaluates the parser’s resilience when special values like null bytes, invalid Unicode, or control characters are prepended to valid JSON content, identifying risks that could lead to parsing issues or input validation bypasses."
details: "The test sends API requests with JSON payloads that prepend various special characters — such as null bytes ('\\0'), invalid Unicode sequences, or control characters — to valid JSON content (`userBody`). This helps detect whether the application’s JSON parser or request preprocessing logic is vulnerable to input parsing issues or can be tricked into misinterpreting the payload. The test does not use malformed JSON structures, but focuses on injecting control data that could exploit weak parsers or insufficient input sanitization."
impact: "Failure to handle special or unexpected characters in JSON payloads can lead to parsing anomalies, denial of service, or bypass of validation logic. An attacker may exploit these weaknesses to disrupt normal operation, trigger unhandled exceptions, or evade input validation. Ensuring strict and predictable JSON parsing is critical to maintaining application stability and security."
category:
name: MCP_INPUT_VALIDATION
shortName: MCP_INPUT_VALIDATION
displayName: Model Context Protocol (MCP) Security - Input Validation
subCategory: MCP_BREAKING_JSON_PARSING
severity: LOW
tags:
- Business logic
- OWASP top 10
- HackerOne top 10
references:
- https://owasp.org/www-project-web-security-testing-guide/v42/4-Web_Application_Security_Testing/
- https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html
- https://owasp.org/www-project-developer-guide/draft/design/web_app_checklist/validate_inputs/
cwe:
- CWE-20
cve:
- CVE-2018-20679
- CVE-2019-14271
attributes:
nature: INTRUSIVE
plan: PRO
duration: FAST
api_selection_filters:
response_code:
gte: 200
lt: 300
method:
eq: POST
and:
- request_payload:
for_one:
extract: userBody
- request_payload:
for_one:
key:
regex: .*
- request_payload:
contains_all:
- jsonrpc
- method
- params
wordLists:
attemptValues:
- "\0"
- "\ufffe"
- "\uffff"
- "null"
- undefined
- "{"
- "}"
- "["
- "]"
- NaN
- "\x1f"
- "\x7f"
- "\x81"
- "\ud800"
- "\udbff"
- "\udc00"
- "\udfff"
- �
- <script>
- \u0022
responseErrorList:
- Error
- Internal Server
- Failed
- Unauthorized
- access denied
- Forbidden
- Method Not allowed
- Gateway timeout
- request timeout
- server error
- server busy
- authentication error
- authorization error
- validation error
- Permission Denied
- invalid token
- token expired
- session expired
- session timeout
- unexpected error
- unable to process request
- bad request
- service unavailable
- account is locked
- account is blocked
- multiple failed attempts
- Attention Required!
- CloudFlare
- "Sorry, you have been blocked"
execute:
type: multiple
requests:
- req:
- add_header:
x-akto-ignore: 123
- replace_body: "{}"
- validate:
response_code:
gte: 200
lt: 300
response_payload:
length:
gt: 0
not_contains: "${responseErrorList}"
- success: exit
- failure: x2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct?

- req:
- add_header:
x-akto-ignore: 123
- replace_body: "${attemptValues}${userBody}"
- validate:
response_code:
gte: 200
lt: 300
response_payload:
not_contains: "${responseErrorList}"
- success: vulnerable
- failure: exit
87 changes: 87 additions & 0 deletions MCP-Security/MCPBrokenAuthenticationByRemovingToken.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
id: MCP_REMOVE_TOKENS
info:
name: Broken Authentication by removing auth token (MCP)
description: API doesn't validate the authenticity of token. Attacker can remove the auth token and access the endpoint.
details: |
"The endpoint appears to be vulnerable to broken authentication attack. The original request was replayed by removing victim's <b>auth</b> token. The server responded with 2XX success codes.<br>" "<b>Background:</b> Authentication is the process of attempting to verify the digital identity of the sender of a communication. Testing the authentication schema means understanding how the authentication process works and using that information to circumvent the authentication mechanism. While most applications require authentication to gain access to private information or to execute tasks, not every authentication method is able to provide adequate security. Negligence, ignorance, or simple understatement of security threats often result in authentication schemes that can be bypassed by simply skipping the log in page and directly calling an internal page that is supposed to be accessed only after authentication has been performed."
impact: "Broken User authentication is a serious vulnerability. Attackers can gain control to other users’ accounts in the system, read their personal data, and perform sensitive actions on their behalf, like money transactions and sending personal messages."
category:
name: MCP_AUTH
shortName: MCP_AUTH
displayName: Model Context Protocol (MCP) Security - Broken Authentication
subCategory: MCP_REMOVE_TOKENS
severity: HIGH
tags:
- Business logic
- OWASP top 10
- HackerOne top 10
- MCP
references:
- https://owasp.org/www-project-web-security-testing-guide/v42/4-Web_Application_Security_Testing/
- https://github.com/OWASP/API-Security/blob/master/editions/2023/en/0xa2-broken-authentication.md
- https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
- https://cwe.mitre.org/data/definitions/798.html
cwe:
- CWE-287
- CWE-306
cve:
- CVE-2023-22501
attributes:
nature: NON_INTRUSIVE
plan: PRO
duration: FAST
api_selection_filters:
response_code:
gte: 200
lt: 300
request_payload:
contains_all:
- jsonrpc
- method
- params
response_payload:
length:
gt: 0
method:
eq: POST
execute:
type: single
requests:
- req:
- modify_url: http://mcp.razorpay.com/message
- remove_auth_header: true
validate:
response_code:
gte: 200
lt: 300
response_payload:
not_contains:
- Error
- Internal Server
- Failed
- Unauthorized
- access denied
- Forbidden
- Method Not allowed
- Gateway timeout
- request timeout
- server error
- server busy
- authentication error
- authorization error
- validation error
- Permission Denied
- invalid token
- token expired
- session expired
- session timeout
- unexpected error
- unable to process request
- bad request
- service unavailable
- account is locked
- account is blocked
- multiple failed attempts
- invalid credentials
- Authentication failed
Loading