Skip to content

Commit cf5a5d0

Browse files
authored
Merge pull request #18 from meleksabit/stage
security: patch security issues
2 parents 2f97081 + 8c7e1e1 commit cf5a5d0

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.github/workflows/pr-title-linter.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: PR Title Check
2-
2+
permissions:
3+
contents: read
4+
pull-requests: write
35
on:
46
pull_request:
57
types: [opened, edited]

ai-agent/ai_agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async def health_check():
103103
raise e
104104
except Exception as e:
105105
logger.error(f"Health check failed: {e}")
106-
return {"status": "unhealthy", "error": str(e)}
106+
return {"status": "unhealthy", "error": "Health check failed due to an internal error"}
107107

108108
# Vault client setup
109109
@lru_cache(maxsize=1)
@@ -251,3 +251,4 @@ async def poll_blockchain(web3):
251251
if __name__ == "__main__":
252252
import uvicorn
253253
uvicorn.run(app, host="0.0.0.0", port=8000)
254+

go-services/blockchain-monitor/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import (
44
"context"
55
"fmt"
66
"log"
7+
"math"
78
"math/big"
9+
"errors"
810
"net/http"
911
"os"
1012
"strconv"
@@ -150,6 +152,9 @@ func (s *BlockchainService) GetLatestBlock(ctx context.Context) (uint64, error)
150152
}
151153

152154
func (s *BlockchainService) GetTransactionCount(ctx context.Context, blockNumber uint64) (uint, error) {
155+
if blockNumber > uint64(math.MaxInt64) {
156+
return 0, errors.New("block number exceeds maximum int64 value")
157+
}
153158
block, err := s.client.BlockByNumber(ctx, big.NewInt(int64(blockNumber)))
154159
if err != nil {
155160
return 0, err

0 commit comments

Comments
 (0)