The C and C++ Include Header Files
/usr/include/nodejs/src/node_revert.h
$ cat -n /usr/include/nodejs/src/node_revert.h 1 #ifndef SRC_NODE_REVERT_H_ 2 #define SRC_NODE_REVERT_H_ 3 4 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 5 6 #include "node.h" 7 8 /** 9 * Note that it is expected for this list to vary across specific LTS and 10 * Stable versions! Only CVE's whose fixes require *breaking* changes within 11 * a given LTS or Stable may be added to this list, and only with TSC 12 * consensus. 13 * 14 * For *master* this list should always be empty! 15 **/ 16 namespace node { 17 18 #define SECURITY_REVERSIONS(XX) \ 19 XX(CVE_2019_9512, "CVE-2019-9512", "HTTP/2 Ping/Settings Flood") \ 20 XX(CVE_2019_9514, "CVE-2019-9514", "HTTP/2 Reset Flood") \ 21 XX(CVE_2019_9516, "CVE-2019-9516", "HTTP/2 0-Length Headers Leak") \ 22 XX(CVE_2019_9518, "CVE-2019-9518", "HTTP/2 Empty DATA Frame Flooding") \ 23 XX(CVE_2021_44531, "CVE-2021-44531", "Cert Verif Bypass via URI SAN") \ 24 XX(CVE_2021_44532, "CVE-2021-44532", "Cert Verif Bypass via Str Inject") \ 25 // XX(CVE_2016_PEND, "CVE-2016-PEND", "Vulnerability Title") 26 // TODO(addaleax): Remove all of the above before Node.js 13 as the comment 27 // at the start of the file indicates. 28 29 enum reversion { 30 #define V(code, ...) SECURITY_REVERT_##code, 31 SECURITY_REVERSIONS(V) 32 #undef V 33 }; 34 35 namespace per_process { 36 extern unsigned int reverted_cve; 37 } 38 39 inline const char* RevertMessage(const reversion cve) { 40 #define V(code, label, msg) case SECURITY_REVERT_##code: return label ": " msg; 41 switch (cve) { 42 SECURITY_REVERSIONS(V) 43 default: 44 return "Unknown"; 45 } 46 #undef V 47 } 48 49 inline void Revert(const reversion cve) { 50 per_process::reverted_cve |= 1 << cve; 51 printf("SECURITY WARNING: Reverting %s\n", RevertMessage(cve)); 52 } 53 54 inline void Revert(const char* cve, std::string* error) { 55 #define V(code, label, _) \ 56 if (strcmp(cve, label) == 0) return Revert(SECURITY_REVERT_##code); 57 SECURITY_REVERSIONS(V) 58 #undef V 59 *error = "Error: Attempt to revert an unknown CVE ["; 60 *error += cve; 61 *error += ']'; 62 } 63 64 inline bool IsReverted(const reversion cve) { 65 return per_process::reverted_cve & (1 << cve); 66 } 67 68 inline bool IsReverted(const char* cve) { 69 #define V(code, label, _) \ 70 if (strcmp(cve, label) == 0) return IsReverted(SECURITY_REVERT_##code); 71 SECURITY_REVERSIONS(V) 72 return false; 73 #undef V 74 } 75 76 } // namespace node 77 78 #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 79 80 #endif // SRC_NODE_REVERT_H_
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2024 MyWebUniversity.com ™