@@ -338,8 +338,32 @@ router.get("/blockchain/next-halving", asyncHandler(async (req, res, next) => {
338
338
339
339
/// ADDRESSES
340
340
341
+ // encountered huge volume of traffic requesting the balance for top address
342
+ // here, from many different ips, the below page leads me to believe the addresses
343
+ // are associated with malware and the public instance API is being abused to
344
+ // aid the malware - block the requests
345
+ // ref: https://pberba.github.io/crypto/2024/09/14/malicious-browser-extension-genesis-market/
346
+ const blacklistedAddresses = [
347
+ "bc1q4fkjqusxsgqzylcagra800cxljal82k6y3ejay" ,
348
+ "bc1qvmvz53hdauzxuhs7dkm775tlqtd9vpk8ux7mqj" ,
349
+ "bc1qtms60m4fxhp5v229kfxwd3xruu48c4a0tqwafu" ,
350
+ "bc1qvkvzfla6wrem2uf4ejkuja8yp3c6f3xf72kyc9" ,
351
+ "bc1qnxwt7sr3rqatd6efjyym3nsgxhslyzeqndhjpn"
352
+ ] ;
353
+
341
354
router . get ( "/address/:address" , asyncHandler ( async ( req , res , next ) => {
342
355
try {
356
+ const address = utils . asAddress ( req . params . address ) ;
357
+
358
+ if ( blacklistedAddresses . includes ( address ) ) {
359
+ debugLog ( `Blocking request: ip=${ req . ip } , req=${ req . originalUrl } ` )
360
+ res . status ( 418 ) . json ( {
361
+ message : "Teapot" ,
362
+ } ) ;
363
+
364
+ return ;
365
+ }
366
+
343
367
const { perfId, perfResults } = utils . perfLogNewItem ( { action :"api.address" } ) ;
344
368
res . locals . perfId = perfId ;
345
369
@@ -363,8 +387,6 @@ router.get("/address/:address", asyncHandler(async (req, res, next) => {
363
387
}
364
388
365
389
366
- const address = utils . asAddress ( req . params . address ) ;
367
-
368
390
const transactions = [ ] ;
369
391
const addressApiSupport = addressApi . getCurrentAddressApiFeatureSupport ( ) ;
370
392
@@ -481,6 +503,8 @@ router.get("/address/:address", asyncHandler(async (req, res, next) => {
481
503
next ( ) ;
482
504
483
505
} catch ( e ) {
506
+ utils . logError ( "a39ehudsudese" , e ) ;
507
+
484
508
res . json ( { success :false } ) ;
485
509
486
510
next ( ) ;
0 commit comments