It looks like ASN in traceroute result is simply a lookup in BGP RIB for the origin AS of the IP, which works except a default route is installed in BGP RIB. imo if an address can only be matched by the default route, the ASN should be cannot_be_determined. Can someone file a bug to better handle it?
as1r2#traceroute 3.255.255.245 source g0/3
Type escape sequence to abort.
Tracing the route to 3.255.255.245
VRF info: (vrf in name/id, vrf out name/id)
1 172.16.255.5 [AS 4] 3 msec 3 msec 3 msec
2 172.16.255.2 [AS 4] 5 msec 5 msec 6 msec
3 172.16.255.26 [AS 4] 6 msec 6 msec 5 msec
4 172.16.255.34 [AS 4] 6 msec * 4 msec
as1r2#show ip bgp
BGP table version is 18, local router ID is 172.16.254.12
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*>i 0.0.0.0 172.16.254.11 0 100 0 3 4 i
*> 1.255.254.252/30 0.0.0.0 0 32768 i
*>i 1.255.255.128/25 172.16.254.11 0 100 0 i
*>i 3.0.0.0 172.16.254.11 0 100 0 3 {5,4} i