# isCarbonValid method

bool isCarbonValid(

1. JID senderJid

)

Checks if a carbon sent by `senderJid` is valid to prevent vulnerabilities like the ones listed at https://xmpp.org/extensions/xep-0280.html#security.

Returns true if the carbon is valid. Returns false if not.

## Implementation

    bool isCarbonValid(JID senderJid) {
      return _isEnabled &&
          getAttributes().getFullJID().bareCompare(
                senderJid,
                ensureBare: true,
              );
    }