32942 - [BC - Low] The ChainID and URL parameters that can modify ...
Description
Brief/Intro
Vulnerability Details
// This function is used to check if the request is authorized to access the debug endpoint
function handleDebugAuth(_req, res, next, authLevel) {
try {
//auth with a signature
if (_req.query.sig != null && _req.query.sig_counter != null) {
const devPublicKeys = getDevPublicKeys() // This should return list of public keys
const requestSig = _req.query.sig
// Check if signature is valid for any of the public keys
for (const ownerPk in devPublicKeys) {
let sigObj = {
route: _req.route.path,
count: String(_req.query.sig_counter),
sign: { owner: ownerPk, sig: requestSig },
}
// ...........
let verified = Context.crypto.verify(sigObj, ownerPk)
if (verified === true) {
const authorized = ensureKeySecurity(ownerPk, authLevel)
if (authorized) {
lastCounter = currentCounter
next()
return
} else {
// ...........
}The problem: Signing only the path to the endpoint, instead of the full URL including the parameters
Reusing signatures from "testnet"/"devnets" in "mainnet"
Impact Details
Proof of Concept
Last updated
Was this helpful?