Feed aggregator
YouTube Rolls Out Age-Estimation Tech To Identify US Teens, Apply Additional Protections
Read more of this story at Slashdot.
Minnesota Activates National Guard After St. Paul Cyberattack
Read more of this story at Slashdot.
Linux 6.16 Brings Faster File Systems, Improved Confidential Memory Support, and More Rust Support
Read more of this story at Slashdot.
Jack Dorsey's Bluetooth Messaging App Bitchat Now On App Store
Read more of this story at Slashdot.
Cisco Donates the AGNTCY Project to the Linux Foundation
Read more of this story at Slashdot.
ChatGPT's New Study Mode Is Designed To Help You Learn, Not Just Give Answers
Read more of this story at Slashdot.
EPA Moves To Repeal Finding That Allows Climate Regulation
Read more of this story at Slashdot.
Opera Accuses Microsoft of Anti-Competitive Edge Tactics
Read more of this story at Slashdot.
Google Failed To Warn 10 Million of Turkey Earthquake Severity
Read more of this story at Slashdot.
Apple Loses Fourth AI Researcher in a Month To Meta
Read more of this story at Slashdot.
60% of Americans Use AI for Search, Only 37% for Workplace Tasks, New Poll Finds
Read more of this story at Slashdot.
Anthropic Nears Deal To Raise Funding at $170 Billion Valuation
Read more of this story at Slashdot.
The World's Biggest Passenger Planes Keep Breaking Down
Read more of this story at Slashdot.
Apple Opens Manufacturing Academy in Detroit
Read more of this story at Slashdot.
Apple Shift Turns India Into World's Top Maker of US Smartphones
Read more of this story at Slashdot.
AI Boom Sparks Fight Over Soaring Power Costs
Read more of this story at Slashdot.
Dog-Walking Startup 'Wag' Files For Bankruptcy
Read more of this story at Slashdot.
PayPal Expands Crypto Payments For US Merchants To Lower Cross-Border Fees
Read more of this story at Slashdot.
Distorted Sound of the Early Universe Suggests We Are Living In a Giant Void
Read more of this story at Slashdot.
CodeSOD: IsValidToken
To ensure that several services could only be invoked by trusted parties, someone at Ricardo P's employer had the brilliant idea of requiring a token along with each request. Before servicing a request, they added this check:
private bool IsValidToken(string? token) { if (string.Equals("xxxxxxxx-xxxxxx+xxxxxxx+xxxxxx-xxxxxx-xxxxxx+xxxxx", token)) return true; return false; }The token is anonymized here, but it's hard-coded into the code, because checking security tokens into source control, and having tokens that never expire has never caused anyone any trouble.
Which, in the company's defense, they did want the token to expire. The problem there is that they wanted to be able to roll out the new token to all of their services over time, which meant the system had to be able to support both the old and new token for a period of time. And you know exactly how they handled that.
private bool IsValidToken(string? token) { if (string.Equals("xxxxxxxx-xxxxxx+xxxxxxx+xxxxxx-xxxxxx-xxxxxx+xxxxx", token)) return true; else if (string.Equals("yyyyyyy-yyyyyy+yyyyy+yyyyy-yyyyy-yyyyy+yyyy", token)) return true; return false; }For a change, I'm more mad about this insecurity than the if(cond) return true pattern, but boy, I hate that pattern.
[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!