A recent study (Chiyomaru and Takemoto 2022 Phys. Rev. E 106 014301) considered adversarial attacks conducted to distort voter model dynamics in networks. This method intervenes in the interaction patterns of individuals and induces them to be in a target opinion state through a small perturbation ε. In this study, we investigate adversarial attacks on voter dynamics in random networks of finite size n. The exit probability P
+1 to reach the target absorbing state and the mean time τ
n
to reach consensus are analyzed in the mean-field approximation. Given ε > 0, the exit probability P
+1 converges asymptotically to unity as n increases. The mean time τ
n
to reach consensus scales as
(
ln
ϵ
n
)
/
ϵ
for homogeneous networks with a large finite n. By contrast, it scales as
(
ln
(
ϵ
μ
1
2
n
/
μ
2
)
)
/
ϵ
for heterogeneous networks with a large finite n, where µ
1 and µ
2 represent the first and second moments of the degree distribution, respectively. Moreover, we observe the crossover phenomenon of τ
n
from a linear scale to a logarithmic scale and find
n
c
o
∼
ϵ
−
1
/
α
above which the state of all nodes becomes the target state in logarithmic time. Here, α = 1 for homogeneous networks and
α
=
(
γ
−
1
)
/
2
for scale-free networks with a degree exponent
2
<
γ
<
3
.