Hacktricks-skills payment-security-assessment

How to assess payment process security during authorized penetration testing. Use this skill whenever the user mentions payment security testing, transaction flow analysis, payment gateway assessment, or needs to evaluate payment system vulnerabilities in an authorized security engagement. This skill helps identify potential weaknesses in payment flows, parameter handling, and session management for legitimate security audits.

install
source · Clone the upstream repo
git clone https://github.com/abelrguezr/hacktricks-skills
manifest: skills/pentesting-web/bypass-payment-process/SKILL.MD
source content

Payment Security Assessment

⚠️ Authorization Required

This skill is for authorized security testing only. Before using these techniques:

  • Obtain written authorization from the system owner
  • Ensure you have a valid scope of work
  • Follow responsible disclosure practices
  • Comply with applicable laws and regulations

Unauthorized payment manipulation is illegal and unethical.

Overview

This skill guides you through assessing payment process security during authorized penetration testing engagements. Payment systems are high-value targets and require careful, methodical evaluation.

Assessment Methodology

1. Request Interception and Analysis

Monitor data exchange between client and server during transactions. Focus on identifying parameters with security implications:

Key Parameters to Examine:

  • Success/Status indicators: Parameters that determine transaction outcome
  • Referrer/Source: Parameters indicating request origin
  • Callback/Redirect URLs: Post-transaction redirect destinations
  • Amount/Price: Monetary value parameters
  • Order/Transaction IDs: Unique identifiers
  • Checksums/Signatures: Integrity verification values

Analysis Approach:

  1. Capture all requests in the payment flow
  2. Document each parameter's purpose and behavior
  3. Note which parameters are client-controlled vs server-generated
  4. Identify parameters that influence transaction state

2. URL Parameter Analysis

When URLs contain payment-related parameters, especially hash-based identifiers:

Investigation Steps:

  1. Extract and document the URL structure
  2. Identify hash algorithms used (MD5, SHA, etc.)
  3. Test if hash values can be predicted or manipulated
  4. Check for IDOR vulnerabilities in transaction references
  5. Verify proper validation of redirect/callback URLs

Common Patterns to Test:

  • example.com/payment/{HASH}
    - Test hash predictability
  • example.com/callback?status=success
    - Test status manipulation
  • example.com/confirm?order_id=123
    - Test ID enumeration

3. Parameter Manipulation Testing

Value Modification:

  • Change boolean parameters (
    false
    true
    ,
    0
    1
    )
  • Modify status indicators (
    pending
    completed
    )
  • Alter amount values (test for client-side price control)
  • Change currency codes
  • Test parameter type coercion (string vs number)

Parameter Removal:

  • Remove individual parameters to test fallback behavior
  • Remove all optional parameters
  • Test with minimal parameter sets
  • Observe default behaviors when parameters are missing

Parameter Addition:

  • Add unexpected parameters
  • Test for parameter pollution
  • Try duplicate parameters with different values

4. Cookie and Session Analysis

Cookie Examination:

  1. List all cookies set during payment flow
  2. Identify cookies containing:
    • Payment status information
    • User authentication data
    • Session tokens
    • Transaction references
  3. Check cookie security flags (Secure, HttpOnly, SameSite)
  4. Document cookie lifetimes and scope

Session Management:

  • Test session token predictability
  • Verify session binding to payment transactions
  • Check for session fixation vulnerabilities
  • Test session timeout behavior during payment
  • Verify session invalidation after transaction completion

5. Response Analysis and Validation

Response Inspection:

  1. Capture all server responses in the payment flow
  2. Look for:
    • Success/failure indicators
    • Transaction confirmation data
    • Error messages revealing system information
    • Debug information or stack traces
  3. Verify response integrity mechanisms
  4. Check for information disclosure in responses

Response Validation:

  • Verify server-side validation of all critical data
  • Test if client can influence response content
  • Check for proper error handling
  • Ensure sensitive data isn't exposed in responses

Testing Checklist

Use this checklist during assessment:

  • All payment requests intercepted and documented
  • Critical parameters identified and tested
  • URL parameters analyzed for vulnerabilities
  • Parameter manipulation tests completed
  • Cookie security flags verified
  • Session management tested
  • Response validation confirmed
  • Error handling reviewed
  • All findings documented with evidence

Documentation Requirements

For each finding, document:

  1. Vulnerability Type: Category of issue found
  2. Affected Component: Specific parameter, endpoint, or flow
  3. Request/Response Evidence: HTTP data showing the issue
  4. Impact Assessment: Potential business impact
  5. Reproduction Steps: Clear steps to reproduce
  6. Remediation Recommendations: How to fix the issue

Common Vulnerabilities to Look For

  • Client-side price control: Amount determined by client
  • Missing server-side validation: Trusting client-provided status
  • Insecure direct object references: Predictable transaction IDs
  • Broken authentication: Session tokens in payment flow
  • Insufficient logging: Payment events not properly logged
  • Error disclosure: Sensitive information in error messages
  • Missing integrity checks: No signature verification
  • Redirect vulnerabilities: Unvalidated callback URLs

Reporting

When reporting findings:

  1. Prioritize by business impact
  2. Include clear reproduction steps
  3. Provide remediation guidance
  4. Avoid including sensitive test data
  5. Follow the organization's reporting format

Legal and Ethical Considerations

  • Never test payment systems without explicit authorization
  • Do not process real transactions during testing
  • Use test accounts and test payment methods only
  • Report all findings promptly to the system owner
  • Follow responsible disclosure timelines
  • Maintain confidentiality of findings

Tools That May Help

  • Burp Suite / OWASP ZAP for request interception
  • Browser DevTools for cookie and network analysis
  • Custom scripts for parameter fuzzing
  • Session management testing tools

Remember: The goal is to identify and help fix vulnerabilities, not to exploit them. Always act within your authorization scope.