zaproxy/zaproxy · warning · IllegalArgumentException

context.struct.warning.stdparser.dup

Error message

context.struct.warning.stdparser.dup

What it means

Thrown by ContextStructurePanel.validateContextData when a character appears in both the URL Key/Value Pair Separators and Key/Value Separators fields. Overlapping separators make tokenization ambiguous, so ZAP rejects the combination with this message.

Source

Thrown at zap/src/main/java/org/zaproxy/zap/view/ContextStructurePanel.java:215

            this.getPostKvPairSeparators().setText(formStdParamParser.getKeyValuePairSeparators());
            this.getPostKeyValueSeparators().setText(formStdParamParser.getKeyValueSeparators());
        }
    }

    @Override
    public void validateContextData(Session session) throws Exception {
        if (this.urlKvPairSeparators.getText().length() == 0) {
            throw new IllegalArgumentException(
                    Constant.messages.getString("context.struct.warning.stdparser.nokvpsep"));
        }
        if (this.urlKeyValueSeparators.getText().length() == 0) {
            throw new IllegalArgumentException(
                    Constant.messages.getString("context.struct.warning.stdparser.nokvsep"));
        }
        // Don't allow any common characters
        for (char ch : this.urlKvPairSeparators.getText().toCharArray()) {
            if (this.urlKeyValueSeparators.getText().contains("" + ch)) {
                throw new IllegalArgumentException(
                        Constant.messages.getString("context.struct.warning.stdparser.dup"));
            }
        }

        if (this.postKvPairSeparators.getText().length() == 0) {
            throw new IllegalArgumentException(
                    Constant.messages.getString("context.struct.warning.stdparser.nokvpsep"));
        }
        if (this.postKeyValueSeparators.getText().length() == 0) {
            throw new IllegalArgumentException(
                    Constant.messages.getString("context.struct.warning.stdparser.nokvsep"));
        }
        // Don't allow any common characters
        for (char ch : this.postKvPairSeparators.getText().toCharArray()) {
            if (this.postKeyValueSeparators.getText().contains("" + ch)) {
                throw new IllegalArgumentException(
                        Constant.messages.getString("context.struct.warning.stdparser.dup"));
            }

View on GitHub (pinned to 9d1970a436)

Solutions

  1. Remove the shared character from one of the two separator fields so they are disjoint.
  2. Use the standard combination: '&' for pair separators and '=' for key/value separators.
  3. Add a client-side check that the two field contents share no characters before confirming.

Example fix

// before
urlKvPairSeparators.setText("=&"); urlKeyValueSeparators.setText("=");

// after
urlKvPairSeparators.setText("&"); urlKeyValueSeparators.setText("=");
Defensive patterns

Strategy: validation

Validate before calling

String pairs = urlKvPairSeparators.getText(), kvs = urlKeyValueSeparators.getText();
for (char c : pairs.toCharArray()) { if (kvs.indexOf(c) >= 0) { throw new IllegalStateException("Separator overlap: " + c); } }

Try / catch

try { panel.validateContextData(session); } catch (IllegalArgumentException e) { showError(e.getMessage()); }

Prevention

When it happens

Trigger: Saving the structure panel where any character in urlKvPairSeparators also occurs in urlKeyValueSeparators (e.g. both fields containing '=').

Common situations: Users type '=' into both separator fields, or use the same character (like ';') for pair and key/value splitting.

Related errors


AI-assisted analysis of zaproxy/zaproxy@9d1970a436 (2026-09-05). Data as JSON: /api/errors/103bee1e947c710c. Report an issue: GitHub.