a b s t r a c tA stochastic portfolio optimization problem with default risk on an infinite time horizon is investigated. The default risk premium and the default intensity corresponding to the defaultable bond are assumed to rely on a stochastic factor formulated by a diffusion process. We study the optimal allocation and consumption policies to maximize the infinite horizon expected discounted non-log HARA utility of the consumption, and we use the dynamic programming principle to derive the Hamilton-Jacobi-Bellman (HJB) equation. Then we explore the HJB equation by employing a so-called sub-super solution approach. The optimal allocation and consumption policies are finally presented in a verification theorem, and also a numerical simulation is given at the end of the paper.