{"record":{"id":"4438552580b18038","repo":"eclipse-vertx/vert.x","slug":"invalid-escape-sequence-c-c2-at-index-i","errorCode":null,"errorMessage":"invalid escape sequence `%${c}${c2}' at index ${i - 2} of: ${s}","messagePattern":"invalid escape sequence `%(.+?)(.+?)' at index (.+?) of: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/internal/net/RFC3986.java","lineNumber":96,"sourceCode":"      char c = s.charAt(i);\n      if (c == '%') {\n        if (i == size - 1) {\n          throw new IllegalArgumentException(\"unterminated escape\"\n            + \" sequence at end of string: \" + s);\n        }\n        c = s.charAt(++i);\n        if (c == '%') {\n          buf[pos++] = '%';  // \"%%\" -> \"%\"\n          break;\n        }\n        if (i >= size - 1) {\n          throw new IllegalArgumentException(\"partial escape\"\n            + \" sequence at end of string: \" + s);\n        }\n        c = decodeHexNibble(c);\n        final char c2 = decodeHexNibble(s.charAt(++i));\n        if (c == Character.MAX_VALUE || c2 == Character.MAX_VALUE) {\n          throw new IllegalArgumentException(\n            \"invalid escape sequence `%\" + s.charAt(i - 1)\n              + s.charAt(i) + \"' at index \" + (i - 2)\n              + \" of: \" + s);\n        }\n        c = (char) (c * 16 + c2);\n        // shouldn't check for plus since it would be a double decoding\n        buf[pos++] = (byte) c;\n      } else {\n        buf[pos++] = (byte) (plus && c == '+' ? ' ' : c);\n      }\n    }\n    return new String(buf, 0, pos, StandardCharsets.UTF_8);\n  }\n\n  /**\n   * Helper to decode half of a hexadecimal number from a string.\n   * @param c The ASCII character of the hexadecimal number to decode.\n   * Must be in the range {@code [0-9a-fA-F]}.","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/internal/net/RFC3986.java#L78-L114","documentation":"URI decoding failure in decodeAndTransformURIComponent: the two characters following '%' are not valid hexadecimal digits, so decodeHexNibble returned an invalid marker. The message reports the bad sequence and its index within the string; the input at fault is the malformed percent-escape in the URI component.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/internal/net/RFC3986.java:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the escape to valid hex (e.g. '%2F') or encode the literal character properly","Sanitize URIs from untrusted input before decoding"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}