Display validator status only to admin requests:

Several commands allow a user to retrieve a server's status. Commands
will typically limit disclosure of information that can reveal that a
particular server is a validator to connections that are not verified
to make it more difficult to determine validators via fingerprinting.

Prior to this commit, servers configured to operate as validators
would, instead of simply reporting their server state as 'full',
augment their state information to indicate whether they are
'proposing' or 'validating'.

Servers will only provide this enhanced state information for
connections that have elevated privileges.

Acknowledgements:
Ripple thanks Markus Teufelberger for responsibly disclosing this issue.

Bug Bounties and Responsible Disclosures:
We welcome reviews of the rippled code and urge researchers to responsibly
disclose any issues that they may find. For more on Ripple's Bug Bounty
program, please visit: https://ripple.com/bug-bounty
This commit is contained in:
Nik Bougalis
2019-02-21 16:23:49 -08:00
parent 7779dcdda0
commit c6ab880c03
3 changed files with 10 additions and 7 deletions

View File

@@ -237,7 +237,7 @@ public:
{
return mMode;
}
std::string strOperatingMode () const override;
std::string strOperatingMode (bool admin = false) const override;
//
// Transaction operations.
@@ -824,9 +824,9 @@ void NetworkOPsImp::processClusterTimer ()
//------------------------------------------------------------------------------
std::string NetworkOPsImp::strOperatingMode () const
std::string NetworkOPsImp::strOperatingMode (bool admin) const
{
if (mMode == omFULL)
if (mMode == omFULL && admin)
{
auto const mode = mConsensus.mode();
if (mode != ConsensusMode::wrongLedger)
@@ -2103,7 +2103,7 @@ Json::Value NetworkOPsImp::getServerInfo (bool human, bool admin, bool counters)
info [jss::build_version] = BuildInfo::getVersionString ();
info [jss::server_state] = strOperatingMode ();
info [jss::server_state] = strOperatingMode (admin);
info [jss::time] = to_string(date::floor<std::chrono::microseconds>(
std::chrono::system_clock::now()));
@@ -2860,7 +2860,7 @@ bool NetworkOPsImp::subServer (InfoSub::ref isrListener, Json::Value& jvResult,
auto const& feeTrack = app_.getFeeTrack();
jvResult[jss::random] = to_string (uRandom);
jvResult[jss::server_status] = strOperatingMode ();
jvResult[jss::server_status] = strOperatingMode (admin);
jvResult[jss::load_base] = feeTrack.getLoadBase ();
jvResult[jss::load_factor] = feeTrack.getLoadFactor ();
jvResult [jss::hostid] = getHostId (admin);