Firefox · Security/NSS
CVE-2026-109709
Logic Error in Security/NSS
Overview
High
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Changed Functions
| Function | Change | Notes |
|---|---|---|
ifsecurity/sandbox/linux/broker/SandboxBroker.cpp |
modified |
Files Changed
security/sandbox/linux/broker/SandboxBroker.cppsecurity/sandbox/linux/broker/SandboxBroker.h
Patch
diff --git a/security/sandbox/linux/broker/SandboxBroker.cpp b/security/sandbox/linux/broker/SandboxBroker.cpp
index 8088397aff7..c1265bdaf81 100644
--- a/security/sandbox/linux/broker/SandboxBroker.cpp
+++ b/security/sandbox/linux/broker/SandboxBroker.cpp
@@ -627,28 +627,22 @@ nsCString SandboxBroker::ReverseSymlinks(const nsACString& aPath) {
}
}
-int SandboxBroker::SymlinkPermissions(const char* aPath,
- const size_t aPathLen) {
- // Work on a temporary copy, so we can reverse it.
- // Because we bail on a writable dir, SymlinkPath
- // might not restore the callers' path exactly.
- char pathBufSymlink[kMaxPathLen + 1];
- base::strlcpy(pathBufSymlink, aPath, sizeof(pathBufSymlink));
-
- nsCString orig =
- ReverseSymlinks(nsDependentCString(pathBufSymlink, aPathLen));
- if (!orig.IsEmpty()) {
+int SandboxBroker::SymlinkPermissions(const nsACString& aPath) {
+ nsCString path = ReverseSymlinks(aPath);
+ if (path.IsEmpty()) {
+ path = aPath;
+ } else {
if (SandboxInfo::Get().Test(SandboxInfo::kVerbose)) {
- SANDBOX_LOG("Reversing %s -> %s", aPath, orig.get());
+ SANDBOX_LOG("Reversing %s -> %s", PromiseFlatCString(aPath).get(),
+ path.get());
}
- base::strlcpy(pathBufSymlink, orig.get(), sizeof(pathBufSymlink));
}
int perms = 0;
// Resolve relative paths, propagate permissions and
// fail if a symlink is in a writable path. The output is in perms.
- char* result = SandboxBroker::SymlinkPath(mPolicy.get(), pathBufSymlink,
- nullptr, &perms);
+ char* result =
+ SandboxBroker::SymlinkPath(mPolicy.get(), path.get(), nullptr, &perms);
if (result != nullptr) {
free(result);
// We finished the translation, so we have a usable return in "perms".
@@ -799,7 +793,8 @@ void SandboxBroker::ThreadMain(void) {
// Then try to figure out the original path and see if that is
// readable. Work on the original path, this reverses
// ConvertRelative above.
- int symlinkPerms = SymlinkPermissions(recvBuf, first_len);
+ int symlinkPerms =
+ SymlinkPermissions(nsDependentCString(recvBuf, first_len));
if (symlinkPerms > 0) {
perms = symlinkPerms;
}
diff --git a/security/sandbox/linux/broker/SandboxBroker.h b/security/sandbox/linux/broker/SandboxBroker.h
index bc4a8ec79c7..a713406f048 100644
--- a/security/sandbox/linux/broker/SandboxBroker.h
+++ b/security/sandbox/linux/broker/SandboxBroker.h
@@ -165,7 +165,7 @@ class SandboxBroker final : private SandboxBrokerCommon,
size_t RealPath(char* aPath, size_t aBufSize, size_t aPathLen);
nsCString ReverseSymlinks(const nsACString& aPath);
// Retrieves permissions for the path the original symlink sits in.
- int SymlinkPermissions(const char* aPath, const size_t aPathLen);
+ int SymlinkPermissions(const nsACString& aPath);
// In SandboxBrokerRealPath.cpp
char* SymlinkPath(const Policy* aPolicy, const char* __restrict aPath,
char* __restrict aResolved, int* aPermission);
Loading diff…
References
On This Page