# VNX-651: Exposure of WSDL File Containing Sensitive Information

Reports a WSDL or XSD that publishes a credential value, a credentialed endpoint address or a debug/internal operation.

| Field | Value |
|---|---|
| Rule ID | `VNX-651` |
| Severity | Medium |
| SARIF level | `warning` |
| Kind | `sast` |
| Languages | Java, Python, C#, XML |
| CWE | [CWE-651](https://cwe.mitre.org/data/definitions/651.html) |
| CAPEC | [CAPEC-66](https://capec.mitre.org/data/definitions/66.html) |
| ATT&CK | [T1190](https://attack.mitre.org/techniques/T1190/) |
| CWSS vector | `CWSS:1.0/TI:M/AP:RU/AL:S/IC:N/FC:LT/RP:RU/RL:S/AV:L/AS:N/IN:A/SC:A/BI:M/DI:H/EX:M/EC:N/P:C` |
| Tags | `wsdl` `soap` `information-exposure` `cwe-651` |
| Source | [`internal/sast/rules/vnx-651.rego`](https://github.com/Vulnesis/cli/blob/main/internal/sast/rules/vnx-651.rego) |

## Overview

VNX-651 maps to [CWE-651: Exposure of WSDL File Containing Sensitive Information](https://cwe.mitre.org/data/definitions/651.html). A WSDL is handed to every client that asks for `?wsdl`. The rule reports what it should not contain:

- In `.wsdl` and `.xsd` files: an element or attribute whose name ends in a credential word (`adminPassword`, `client_secret`, `apiKey`, `token`, `privateKey`) with a non-empty `default=` or `fixed=` value that is not a number, a boolean or `Bearer`, and a `soap:address`/`soap12:address`/`http:address` `location` with `user:password@` in it.
- An operation named like a back door: `debug*`, `internal*`, `dump*`, `backdoor*`, `hidden*`, `exec`/`execute`/`run` + `Command`/`Shell`/`Sql`/`Script`/`Query`, and `get*Password`/`Secret`/`PrivateKey`/`Credentials`.
- The same names on code that generates the WSDL: a Java `@WebMethod`, a Python spyne `@rpc`/`@srpc`, a C# WCF `[OperationContract]`.

Not reported: ordinary operations (`changePassword`, `getPasswordPolicy`, `testConnection`, `executeOrder`), credential elements without a value, settings that only describe a credential (`tokenType`, `passwordMinLength`), https or credential-free addresses, `@WebMethod(exclude = true)`, methods without the service annotation, comments and string literals.

## Why this matters

A WSDL is a map of the service. An operation left in it for debugging tells an attacker exactly which call dumps sessions or runs SQL, and a default password in the schema is a password published to anyone.

## What gets flagged

```xml
<!-- FLAGGED -->
<xs:element name="adminPassword" type="xs:string" default="Winter2024!"/>
<soap:address location="http://svc_admin:S3cretPass@10.0.4.12:8080/account"/>
<operation name="debugDumpSessions">
```

```java
@WebMethod
public String internalResetCache(String region) {   // FLAGGED
```

```python
@rpc(_returns=Unicode)
def dump_all_tokens(ctx):                            # FLAGGED
```

## Remediation

1. Remove debug and internal operations from the published contract (`@WebMethod(exclude = true)`, a separate internal endpoint) or protect them with authentication.
2. Never put credential values in a schema `default`/`fixed` or an endpoint address.
3. Restrict who can fetch the WSDL in production when the service is not public.

## References

- [CWE-651: Exposure of WSDL File Containing Sensitive Information](https://cwe.mitre.org/data/definitions/651.html)
- [OWASP Web Service Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Web_Service_Security_Cheat_Sheet.html)

## Suppressing this rule

Put a `nosec` comment on the line, or on line 1 to cover the whole file. Use the comment marker of the file's language (`#`, `//`, `--` or `;`):

```text
# nosec vnx-651
// nosec vnx-651
```

Or record an ignore rule: `vulnetix ignore add --rule vnx-651 --reason "..."`. See [Suppressing findings](/sast/guides/suppressing-findings.md).
