{"record":{"id":"e98c38e9a693114f","repo":"google/tsunami-security-scanner","slug":"remote-plugin-server-port-out-of-range-expected-0-s-actual-s","errorCode":null,"errorMessage":"Remote plugin server port out of range. Expected [0, %s], actual %s.","messagePattern":"Remote plugin server port out of range\\. Expected \\[0, (.+?)\\], actual (.+?)\\.","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"main/src/main/java/com/google/tsunami/main/cli/LanguageServerOptions.java","lineNumber":139,"sourceCode":"            String.format(\n                \"Number of remote plugin server paths must be equal to number of plugin server \"\n                    + \"ports. Addresses: %s. Ports: %s.\",\n                addrCounts, portCounts));\n      }\n\n      if (!remotePluginServerRpcDeadlineSeconds.isEmpty()) {\n        if (remotePluginServerRpcDeadlineSeconds.size() != addrCounts) {\n          throw new ParameterException(\n              String.format(\n                  \"Number of plugin server rpc deadlines must be equal to number of plugin server\"\n                      + \" ports. Paths: %s. Ports: %s. Deadlines: %s\",\n                  addrCounts, portCounts, pluginServerRpcDeadlineSeconds.size()));\n        }\n      }\n\n      for (int port : remotePluginServerPort) {\n        if (!(port <= NetworkEndpointUtils.MAX_PORT_NUMBER && port > 0)) {\n          throw new ParameterException(\n              String.format(\n                  \"Remote plugin server port out of range. Expected [0, %s], actual %s.\",\n                  NetworkEndpointUtils.MAX_PORT_NUMBER, port));\n        }\n      }\n    }\n  }\n}\n","sourceCodeStart":121,"sourceCodeEnd":148,"githubUrl":"https://github.com/google/tsunami-security-scanner/blob/363ba87b3543f8ae8e4304d3416818f03da7f262/main/src/main/java/com/google/tsunami/main/cli/LanguageServerOptions.java#L121-L148","documentation":"LanguageServerOptions.validate() checks every --remote-plugin-server-port value against NetworkEndpointUtils.MAX_PORT_NUMBER and rejects ports that are <= 0 (despite the message text saying 'Expected [0, ...]'). This guarantees remote plugin server endpoints are valid TCP ports before Tsunami connects to them.","triggerScenarios":"Passing a remote plugin server port of 0, negative, or greater than 65535 (NetworkEndpointUtils.MAX_PORT_NUMBER) to --remote-plugin-server-port, evaluated in the for-loop at LanguageServerOptions.java:139.","commonSituations":"Typo like 99966 instead of 9996; using port 0 by mistake; forgetting the flag expects port numbers, not full host:port strings parsed to an out-of-range number.","solutions":["Set each --remote-plugin-server-port value to an integer in 1..65535.","Verify the plugin server actually listens on the configured port.","Check for typos or duplicated digits in the port list."],"exampleFix":"// before\n--remote-plugin-server-port=99966\n// after\n--remote-plugin-server-port=9996","handlingStrategy":"validation","validationCode":"boolean valid = ports.stream().allMatch(p -> p > 0 && p <= 65535);","typeGuard":null,"tryCatchPattern":"try { options.validate(); } catch (ParameterException e) { throw new IllegalArgumentException(\"Bad remote plugin server port: \" + e.getMessage(), e); }","preventionTips":["Check port ranges (1-65535) in any script that generates Tsunami flags.","Confirm the plugin server listens on the configured port before launching the scan.","Avoid hand-editing port digits; use variables."],"tags":["cli","config-validation","port","java"],"backgroundTag":"value-out-of-range","analyzedSha":"363ba87b3543f8ae8e4304d3416818f03da7f262","analyzedAt":"2026-09-13T01:50:53.990Z","contentChangedAt":"2026-09-13T01:50:53.990Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}