We introduce a probabilistic framework that represents stylized banking networks with the aim of predicting the size of contagion events. Most previous work on random financial networks assumes independent connections between banks, whereas our framework explicitly allows for (dis)assortative edge probabilities (e.g., a tendency for small banks to link to large banks). We analyze default cascades triggered by shocking the network and find that the cascade can be understood as an explicit iterated mapping on a set of edge probabilities that converges to a fixed point. We derive a cascade condition that characterizes whether or not an infinitesimal shock to the network can grow to a finite size cascade, in analogy to the basic reproduction number $R_0$ in epidemic modelling. The cascade condition provides an easily computed measure of the systemic risk inherent in a given banking network topology. Using the percolation theory for random networks we also derive an analytic formula for the frequency of global cascades. Although the analytical methods are derived for infinite networks, we demonstrate using Monte Carlo simulations the applicability of the results to finite-sized networks. We show that edge-assortativity, the propensity of nodes to connect to similar nodes, can have a strong effect on the level of systemic risk as measured by the cascade condition. However, the effect of assortativity on systemic risk is subtle, and we propose a simple graph theoretic quantity, which we call the graph-assortativity coefficient, that can be used to assess systemic risk.